254 lines
12 KiB
C
254 lines
12 KiB
C
![]() |
#pragma once
|
||
|
// EXLRange wrapper class
|
||
|
|
||
|
#include "office/VariantableDispatch.hpp"
|
||
|
|
||
|
#undef DialogBox
|
||
|
|
||
|
namespace MSO::Excel {
|
||
|
static constexpr long xlRangeValueDefault = 10;
|
||
|
static constexpr long xlRangeValueXMLSpreadsheet = 11;
|
||
|
static constexpr long xlRangeValueMSPersistXML = 12;
|
||
|
|
||
|
class EXLRange : public VariantableDispatch {
|
||
|
public:
|
||
|
EXLRange() = default;
|
||
|
EXLRange(LPDISPATCH pDispatch) : VariantableDispatch(pDispatch) {}
|
||
|
EXLRange(const EXLRange& dispatchSrc) : VariantableDispatch(dispatchSrc) {}
|
||
|
|
||
|
public:
|
||
|
template<typename IndexType>
|
||
|
EXLRange operator()(const IndexType& RowIndex, const IndexType& ColumnIndex);
|
||
|
|
||
|
public:
|
||
|
void put_Item(long RowIndex, long ColumnIndex, const VARIANT& newValue);
|
||
|
|
||
|
EXLRange get_Item(VARIANT RowIndex, VARIANT ColumnIndex);
|
||
|
void put_Item(VARIANT RowIndex, VARIANT ColumnIndex, VARIANT newValue);
|
||
|
EXLRange get_Columns();
|
||
|
EXLRange get_Rows();
|
||
|
EXLRange get_Cells();
|
||
|
VARIANT get_Value(VARIANT RangeValueDataType = _variant_t(xlRangeValueDefault));
|
||
|
|
||
|
LPDISPATCH get_Application();
|
||
|
long get_Creator();
|
||
|
LPDISPATCH get_Parent();
|
||
|
VARIANT Activate();
|
||
|
VARIANT get_AddIndent();
|
||
|
void put_AddIndent(VARIANT newValue);
|
||
|
CString get_Address(VARIANT RowAbsolute, VARIANT ColumnAbsolute, long ReferenceStyle, VARIANT External, VARIANT RelativeTo);
|
||
|
CString get_AddressLocal(VARIANT RowAbsolute, VARIANT ColumnAbsolute, long ReferenceStyle, VARIANT External, VARIANT RelativeTo);
|
||
|
VARIANT AdvancedFilter(long Action, VARIANT CriteriaRange, VARIANT CopyToRange, VARIANT Unique);
|
||
|
VARIANT ApplyNames(VARIANT Names, VARIANT IgnoreRelativeAbsolute, VARIANT UseRowColumnNames, VARIANT OmitColumn, VARIANT OmitRow, long Order, VARIANT AppendLast);
|
||
|
VARIANT ApplyOutlineStyles();
|
||
|
LPDISPATCH get_Areas();
|
||
|
CString AutoComplete(LPCTSTR String);
|
||
|
VARIANT AutoFill(LPDISPATCH Destination, long Type);
|
||
|
VARIANT AutoFilter(VARIANT Field, VARIANT Criteria1, long Operator, VARIANT Criteria2, VARIANT VisibleDropDown);
|
||
|
VARIANT AutoFit();
|
||
|
VARIANT AutoFormat(long Format, VARIANT Number, VARIANT Font, VARIANT Alignment, VARIANT Border, VARIANT Pattern, VARIANT Width);
|
||
|
VARIANT AutoOutline();
|
||
|
VARIANT _BorderAround(VARIANT LineStyle, long Weight, long ColorIndex, VARIANT Color);
|
||
|
LPDISPATCH get_Borders();
|
||
|
VARIANT Calculate();
|
||
|
LPDISPATCH get_Characters(VARIANT Start, VARIANT Length);
|
||
|
VARIANT CheckSpelling(VARIANT CustomDictionary, VARIANT IgnoreUppercase, VARIANT AlwaysSuggest, VARIANT SpellLang);
|
||
|
VARIANT Clear();
|
||
|
VARIANT ClearContents();
|
||
|
VARIANT ClearFormats();
|
||
|
VARIANT ClearNotes();
|
||
|
VARIANT ClearOutline();
|
||
|
long get_Column();
|
||
|
LPDISPATCH ColumnDifferences(VARIANT Comparison);
|
||
|
VARIANT get_ColumnWidth();
|
||
|
void put_ColumnWidth(VARIANT newValue);
|
||
|
VARIANT Consolidate(VARIANT Sources, VARIANT Function, VARIANT TopRow, VARIANT LeftColumn, VARIANT CreateLinks);
|
||
|
VARIANT Copy(VARIANT Destination);
|
||
|
long CopyFromRecordset(LPUNKNOWN Data, VARIANT MaxRows, VARIANT MaxColumns);
|
||
|
VARIANT CopyPicture(long Appearance, long Format);
|
||
|
long get_Count();
|
||
|
VARIANT CreateNames(VARIANT Top, VARIANT Left, VARIANT Bottom, VARIANT Right);
|
||
|
VARIANT CreatePublisher(VARIANT Edition, long Appearance, VARIANT ContainsPICT, VARIANT ContainsBIFF, VARIANT ContainsRTF, VARIANT ContainsVALU);
|
||
|
LPDISPATCH get_CurrentArray();
|
||
|
LPDISPATCH get_CurrentRegion();
|
||
|
VARIANT Cut(VARIANT Destination);
|
||
|
VARIANT DataSeries(VARIANT Rowcol, long Type, long Date, VARIANT Step, VARIANT Stop, VARIANT Trend);
|
||
|
VARIANT get__Default(VARIANT RowIndex, VARIANT ColumnIndex);
|
||
|
void put__Default(VARIANT RowIndex, VARIANT ColumnIndex, VARIANT newValue);
|
||
|
VARIANT Delete(VARIANT Shift);
|
||
|
LPDISPATCH get_Dependents();
|
||
|
VARIANT DialogBox();
|
||
|
LPDISPATCH get_DirectDependents();
|
||
|
LPDISPATCH get_DirectPrecedents();
|
||
|
VARIANT EditionOptions(long Type, long Option, VARIANT Name, VARIANT Reference, long Appearance, long ChartSize, VARIANT Format);
|
||
|
LPDISPATCH get_End(long Direction);
|
||
|
LPDISPATCH get_EntireColumn();
|
||
|
LPDISPATCH get_EntireRow();
|
||
|
VARIANT FillDown();
|
||
|
VARIANT FillLeft();
|
||
|
VARIANT FillRight();
|
||
|
VARIANT FillUp();
|
||
|
LPDISPATCH Find(VARIANT What, VARIANT After, VARIANT LookIn, VARIANT LookAt, VARIANT SearchOrder, long SearchDirection, VARIANT MatchCase, VARIANT MatchByte, VARIANT SearchFormat);
|
||
|
LPDISPATCH FindNext(VARIANT After);
|
||
|
LPDISPATCH FindPrevious(VARIANT After);
|
||
|
LPDISPATCH get_Font();
|
||
|
VARIANT get_Formula();
|
||
|
void put_Formula(VARIANT newValue);
|
||
|
VARIANT get_FormulaArray();
|
||
|
void put_FormulaArray(VARIANT newValue);
|
||
|
long get_FormulaLabel();
|
||
|
void put_FormulaLabel(long newValue);
|
||
|
VARIANT get_FormulaHidden();
|
||
|
void put_FormulaHidden(VARIANT newValue);
|
||
|
VARIANT get_FormulaLocal();
|
||
|
void put_FormulaLocal(VARIANT newValue);
|
||
|
VARIANT get_FormulaR1C1();
|
||
|
void put_FormulaR1C1(VARIANT newValue);
|
||
|
VARIANT get_FormulaR1C1Local();
|
||
|
void put_FormulaR1C1Local(VARIANT newValue);
|
||
|
VARIANT FunctionWizard();
|
||
|
BOOL GoalSeek(VARIANT Goal, LPDISPATCH ChangingCell);
|
||
|
VARIANT Group(VARIANT Start, VARIANT End, VARIANT By, VARIANT Periods);
|
||
|
VARIANT get_HasArray();
|
||
|
VARIANT get_HasFormula();
|
||
|
VARIANT get_Height();
|
||
|
VARIANT get_Hidden();
|
||
|
void put_Hidden(VARIANT newValue);
|
||
|
VARIANT get_HorizontalAlignment();
|
||
|
void put_HorizontalAlignment(VARIANT newValue);
|
||
|
VARIANT get_IndentLevel();
|
||
|
void put_IndentLevel(VARIANT newValue);
|
||
|
void InsertIndent(long InsertAmount);
|
||
|
VARIANT Insert(VARIANT Shift, VARIANT CopyOrigin);
|
||
|
LPDISPATCH get_Interior();
|
||
|
VARIANT Justify();
|
||
|
VARIANT get_Left();
|
||
|
long get_ListHeaderRows();
|
||
|
VARIANT ListNames();
|
||
|
long get_LocationInTable();
|
||
|
VARIANT get_Locked();
|
||
|
void put_Locked(VARIANT newValue);
|
||
|
void Merge(VARIANT Across);
|
||
|
void UnMerge();
|
||
|
LPDISPATCH get_MergeArea();
|
||
|
VARIANT get_MergeCells();
|
||
|
void put_MergeCells(VARIANT newValue);
|
||
|
VARIANT get_Name();
|
||
|
void put_Name(VARIANT newValue);
|
||
|
VARIANT NavigateArrow(VARIANT TowardPrecedent, VARIANT ArrowNumber, VARIANT LinkNumber);
|
||
|
LPUNKNOWN get_NewEnum();
|
||
|
LPDISPATCH get_Next();
|
||
|
CString NoteText(VARIANT Text, VARIANT Start, VARIANT Length);
|
||
|
VARIANT get_NumberFormat();
|
||
|
void put_NumberFormat(VARIANT newValue);
|
||
|
VARIANT get_NumberFormatLocal();
|
||
|
void put_NumberFormatLocal(VARIANT newValue);
|
||
|
LPDISPATCH get_Offset(VARIANT RowOffset, VARIANT ColumnOffset);
|
||
|
VARIANT get_Orientation();
|
||
|
void put_Orientation(VARIANT newValue);
|
||
|
VARIANT get_OutlineLevel();
|
||
|
void put_OutlineLevel(VARIANT newValue);
|
||
|
long get_PageBreak();
|
||
|
void put_PageBreak(long newValue);
|
||
|
VARIANT Parse(VARIANT ParseLine, VARIANT Destination);
|
||
|
VARIANT _PasteSpecial(long Paste, long Operation, VARIANT SkipBlanks, VARIANT Transpose);
|
||
|
LPDISPATCH get_PivotField();
|
||
|
LPDISPATCH get_PivotItem();
|
||
|
LPDISPATCH get_PivotTable();
|
||
|
LPDISPATCH get_Precedents();
|
||
|
VARIANT get_PrefixCharacter();
|
||
|
LPDISPATCH get_Previous();
|
||
|
VARIANT __PrintOut(VARIANT From, VARIANT To, VARIANT Copies, VARIANT Preview, VARIANT ActivePrinter, VARIANT PrintToFile, VARIANT Collate);
|
||
|
VARIANT PrintPreview(VARIANT EnableChanges);
|
||
|
LPDISPATCH get_QueryTable();
|
||
|
LPDISPATCH get_Range(VARIANT Cell1, VARIANT Cell2);
|
||
|
VARIANT RemoveSubtotal();
|
||
|
BOOL Replace(VARIANT What, VARIANT Replacement, VARIANT LookAt, VARIANT SearchOrder, VARIANT MatchCase, VARIANT MatchByte, VARIANT SearchFormat, VARIANT ReplaceFormat);
|
||
|
LPDISPATCH get_Resize(VARIANT RowSize, VARIANT ColumnSize);
|
||
|
long get_Row();
|
||
|
LPDISPATCH RowDifferences(VARIANT Comparison);
|
||
|
VARIANT get_RowHeight();
|
||
|
void put_RowHeight(VARIANT newValue);
|
||
|
VARIANT Run(VARIANT Arg1, VARIANT Arg2, VARIANT Arg3, VARIANT Arg4, VARIANT Arg5, VARIANT Arg6, VARIANT Arg7, VARIANT Arg8, VARIANT Arg9, VARIANT Arg10, VARIANT Arg11, VARIANT Arg12, VARIANT Arg13, VARIANT Arg14, VARIANT Arg15, VARIANT Arg16, VARIANT Arg17, VARIANT Arg18, VARIANT Arg19, VARIANT Arg20, VARIANT Arg21, VARIANT Arg22, VARIANT Arg23, VARIANT Arg24, VARIANT Arg25, VARIANT Arg26, VARIANT Arg27, VARIANT Arg28, VARIANT Arg29, VARIANT Arg30);
|
||
|
VARIANT Select();
|
||
|
VARIANT Show();
|
||
|
VARIANT ShowDependents(VARIANT Remove);
|
||
|
VARIANT get_ShowDetail();
|
||
|
void put_ShowDetail(VARIANT newValue);
|
||
|
VARIANT ShowErrors();
|
||
|
VARIANT ShowPrecedents(VARIANT Remove);
|
||
|
VARIANT get_ShrinkToFit();
|
||
|
void put_ShrinkToFit(VARIANT newValue);
|
||
|
VARIANT Sort(VARIANT Key1, long Order1, VARIANT Key2, VARIANT Type, long Order2, VARIANT Key3, long Order3, long Header, VARIANT OrderCustom, VARIANT MatchCase, long Orientation, long SortMethod, long DataOption1, long DataOption2, long DataOption3);
|
||
|
VARIANT SortSpecial(long SortMethod, VARIANT Key1, long Order1, VARIANT Type, VARIANT Key2, long Order2, VARIANT Key3, long Order3, long Header, VARIANT OrderCustom, VARIANT MatchCase, long Orientation, long DataOption1, long DataOption2, long DataOption3);
|
||
|
LPDISPATCH get_SoundNote();
|
||
|
LPDISPATCH SpecialCells(long Type, VARIANT Value);
|
||
|
VARIANT get_Style();
|
||
|
void put_Style(VARIANT newValue);
|
||
|
VARIANT SubscribeTo(LPCTSTR Edition, long Format);
|
||
|
VARIANT Subtotal(long GroupBy, long Function, VARIANT TotalList, VARIANT Replace, VARIANT PageBreaks, long SummaryBelowData);
|
||
|
VARIANT get_Summary();
|
||
|
VARIANT Table(VARIANT RowInput, VARIANT ColumnInput);
|
||
|
VARIANT get_Text();
|
||
|
VARIANT TextToColumns(VARIANT Destination, long DataType, long TextQualifier, VARIANT ConsecutiveDelimiter, VARIANT Tab, VARIANT Semicolon, VARIANT Comma, VARIANT Space, VARIANT Other, VARIANT OtherChar, VARIANT FieldInfo, VARIANT DecimalSeparator, VARIANT ThousandsSeparator, VARIANT TrailingMinusNumbers);
|
||
|
VARIANT get_Top();
|
||
|
VARIANT Ungroup();
|
||
|
VARIANT get_UseStandardHeight();
|
||
|
void put_UseStandardHeight(VARIANT newValue);
|
||
|
VARIANT get_UseStandardWidth();
|
||
|
void put_UseStandardWidth(VARIANT newValue);
|
||
|
LPDISPATCH get_Validation();
|
||
|
void put_Value(VARIANT RangeValueDataType, VARIANT newValue);
|
||
|
VARIANT get_Value2();
|
||
|
void put_Value2(VARIANT newValue);
|
||
|
VARIANT get_VerticalAlignment();
|
||
|
void put_VerticalAlignment(VARIANT newValue);
|
||
|
VARIANT get_Width();
|
||
|
LPDISPATCH get_Worksheet();
|
||
|
VARIANT get_WrapText();
|
||
|
void put_WrapText(VARIANT newValue);
|
||
|
LPDISPATCH AddComment(VARIANT Text);
|
||
|
LPDISPATCH get_Comment();
|
||
|
void ClearComments();
|
||
|
LPDISPATCH get_Phonetic();
|
||
|
LPDISPATCH get_FormatConditions();
|
||
|
long get_ReadingOrder();
|
||
|
void put_ReadingOrder(long newValue);
|
||
|
LPDISPATCH get_Hyperlinks();
|
||
|
LPDISPATCH get_Phonetics();
|
||
|
void SetPhonetic();
|
||
|
CString get_ID();
|
||
|
void put_ID(LPCTSTR newValue);
|
||
|
VARIANT _PrintOut(VARIANT From, VARIANT To, VARIANT Copies, VARIANT Preview, VARIANT ActivePrinter, VARIANT PrintToFile, VARIANT Collate, VARIANT PrToFileName);
|
||
|
LPDISPATCH get_PivotCell();
|
||
|
void Dirty();
|
||
|
LPDISPATCH get_Errors();
|
||
|
LPDISPATCH get_SmartTags();
|
||
|
void Speak(VARIANT SpeakDirection, VARIANT SpeakFormulas);
|
||
|
VARIANT PasteSpecial(long Paste, long Operation, VARIANT SkipBlanks, VARIANT Transpose);
|
||
|
BOOL get_AllowEdit();
|
||
|
LPDISPATCH get_ListObject();
|
||
|
LPDISPATCH get_XPath();
|
||
|
LPDISPATCH get_ServerActions();
|
||
|
void RemoveDuplicates(VARIANT Columns, long Header);
|
||
|
VARIANT PrintOut(VARIANT From, VARIANT To, VARIANT Copies, VARIANT Preview, VARIANT ActivePrinter, VARIANT PrintToFile, VARIANT Collate, VARIANT PrToFileName);
|
||
|
CString get_MDX();
|
||
|
void ExportAsFixedFormat(long Type, VARIANT Filename, VARIANT Quality, VARIANT IncludeDocProperties, VARIANT IgnorePrintAreas, VARIANT From, VARIANT To, VARIANT OpenAfterPublish, VARIANT FixedFormatExtClassPtr);
|
||
|
VARIANT get_CountLarge();
|
||
|
VARIANT CalculateRowMajorOrder();
|
||
|
LPDISPATCH get_SparklineGroups();
|
||
|
void ClearHyperlinks();
|
||
|
LPDISPATCH get_DisplayFormat();
|
||
|
VARIANT BorderAround(VARIANT LineStyle, long Weight, long ColorIndex, VARIANT Color, VARIANT ThemeColor);
|
||
|
void AllocateChanges();
|
||
|
void DiscardChanges();
|
||
|
void FlashFill();
|
||
|
};
|
||
|
|
||
|
template<typename IndexType>
|
||
|
EXLRange EXLRange::operator()(const IndexType& RowIndex, const IndexType& ColumnIndex) {
|
||
|
return get_Item(_variant_t(RowIndex), _variant_t(ColumnIndex));
|
||
|
}
|
||
|
|
||
|
} // namespace MSO::Excel
|