40#include <tqdatetime.h>
42#include "kspread_condition.h"
54class KoOasisLoadingContext;
60class GenValidationStyles;
64class ConditionalDialog;
72 m_cond = Conditional::None;
73 m_action = Action::Stop;
75 displayMessage = true;
76 allowEmptyCell = false;
77 displayValidationInformation = false;
80 bool operator==( const Validity& other ) const
82 if ( message == other.message &&
83 title == other.title &&
84 titleInfo == other.titleInfo &&
85 messageInfo == other.messageInfo &&
86 valMin == other.valMin &&
87 valMax == other.valMax &&
88 m_cond == other.m_cond &&
89 m_action == other.m_action &&
90 m_restriction == other.m_restriction &&
91 timeMin == other.timeMin &&
92 timeMax == other.timeMax &&
93 dateMin == other.dateMin &&
94 dateMax == other.dateMax &&
95 displayMessage == other.displayMessage &&
96 allowEmptyCell == other.allowEmptyCell &&
97 displayValidationInformation == other.displayValidationInformation &&
98 listValidity == other.listValidity )
104 inline bool operator!=( const Validity& other ) const { return !operator==( other ); }
109 TQString messageInfo;
112 Conditional::Type m_cond;
113 Action::Type m_action;
121 bool displayValidationInformation;
122 TQStringList listValidity;
142 Cell (Sheet *_sheet, int _column, int _row);
143 Cell (Sheet *_sheet, Style * _style, int _column, int _row);
153 Sheet* sheet() const;
159 bool isDefault() const;
164 bool isEmpty() const;
180 TQString name() const;
186 TQString fullName() const;
191 TQString columnName() const;
197 static TQString name( int col, int row );
203 static TQString fullName( const Sheet *s, int col, int row );
209 static TQString columnName( uint column );
214 TDELocale* locale() const;
218 bool isFormula() const;
224 TQString text() const;
226 TQString strOutText() const;
231 Format* format() const;
237 const Value value() const;
242 void setValue( const Value& value );
258 void setCellValue ( const Value& value, FormatType fmtType = No_format,
259 const TQString& inputText = TQString());
261 Cell* previousCell() const;
262 Cell* nextCell() const;
263 void setPreviousCell( Cell* c );
264 void setNextCell( Cell* c );
270 void move( int column, int row );
295 TQDomElement save( TQDomDocument& doc, int _x_offset = 0, int _y_offset = 0, bool force = false, bool copy = false, bool era = false );
297 bool saveOasis( KoXmlWriter& xmlwriter, KoGenStyles& mainStyles,
298 int row, int column, int &repeated,
299 GenValidationStyles &valStyle );
301 void saveOasisValue (KoXmlWriter &xmlWriter);
306 TQString saveOasisCellStyle( KoGenStyle ¤tCellStyle,KoGenStyles &mainStyles );
308 bool load( const TQDomElement& cell, int _xshift, int _yshift, Paste::Mode pm = Paste::Normal,
316 bool loadOasis( const TQDomElement & element, KoOasisLoadingContext &oasisContext , Style* style);
318 TQTime toTime( const TQDomElement &element);
319 TQDate toDate( const TQDomElement &element);
326 void copyFormat( const int column, const int row );
332 void copyFormat( const Cell* cell );
333 void copyContent( const Cell* cell );
341 void copyAll( Cell *cell);
350 Border_SizeGrip =0x10
373 void paintCell( const KoRect & rect, TQPainter & painter,
374 View * view, const KoPoint & coordinate,
375 const TQPoint & cellRef,
381 TQValueList<TQPoint> &mergedCellsPainted,
382 bool drawCursor = true );
392 int width( int _col = -1, const Canvas *_canvas = 0L ) const;
400 int height( int _row = -1, const Canvas *_canvas = 0L ) const;
409 double dblWidth( int _col = -1, const Canvas *_canvas = 0L ) const;
417 double dblHeight( int _row = -1, const Canvas *_canvas = 0L ) const;
431 bool needsPrinting() const;
454 void setCellText( const TQString& _text, bool asString = false );
461 void setDisplayText( const TQString& _text );
469 void setLink( const TQString& link );
475 TQString link() const;
490 const TQPen & effLeftBorderPen( int col, int row ) const;
495 const TQPen & effTopBorderPen( int col, int row ) const;
500 const TQPen & effRightBorderPen( int col, int row ) const;
505 const TQPen & effBottomBorderPen( int col, int row ) const;
512 const TQPen & effGoUpDiagonalPen( int col, int row ) const;
517 const TQPen & effFallDiagonalPen( int col, int row ) const;
518 const TQColor & effTextColor( int col, int row ) const;
525 uint effBottomBorderValue( int col, int row ) const;
531 uint effRightBorderValue( int col, int row ) const;
537 uint effLeftBorderValue( int col, int row ) const;
543 uint effTopBorderValue( int col, int row ) const;
548 const TQPen& leftBorderPen( int col, int row ) const;
553 const TQPen& topBorderPen( int col, int row ) const;
558 const TQPen& rightBorderPen( int col, int row ) const;
563 const TQPen& bottomBorderPen( int col, int row ) const;
568 const TQColor& bgColor( int col, int row ) const;
573 const TQBrush& backGroundBrush( int col, int row ) const;
584 void setLeftBorderPen( const TQPen& p );
589 void setTopBorderPen( const TQPen& p );
594 void setRightBorderPen( const TQPen& p );
599 void setBottomBorderPen( const TQPen& p );
613 FormatType formatType() const;
620 void setNumber( double number );
626 void convertToDouble ();
628 void convertToPercent ();
630 void convertToMoney ();
632 void convertToTime ();
634 void convertToDate ();
637 double textWidth() const;
639 double textHeight() const;
648 bool updateChart( bool refresh= true);
650 TQString testAnchor( int _x, int _y ) const;
660 bool calc( bool delay = true);
663 void setCalcDirtyFlag();
665 bool calcDirtyFlag();
683 void setLayoutDirtyFlag( bool format = false );
684 bool layoutDirtyFlag() const;
686 void clearDisplayDirtyFlag();
687 void setDisplayDirtyFlag();
697 void obscure( Cell *cell, bool isForcing = false);
703 void unobscure( Cell* cell);
707 bool isObscured() const;
714 bool isPartOfMerged() const;
722 Cell *ultimateObscuringCell() const;
727 TQValueList<Cell*> obscuringCells() const;
729 void clearObscuringCells();
743 void mergeCells( int _col, int _row, int _x, int _y );
748 bool doesMergeCells() const;
754 int mergedXCells() const;
760 int mergedYCells() const;
765 int extraXCells() const;
770 int extraYCells() const;
772 double extraWidth() const;
773 double extraHeight() const;
784 TQString encodeFormula( bool _era = false, int _col = -1, int _row = -1 ) const;
785 TQString decodeFormula( const TQString &_text, int _col = -1, int _row = -1 ) const;
796 TQString pasteOperation( const TQString &new_text, const TQString &old_text, Paste::Operation op );
802 bool hasError() const;
807 void clearAllErrors();
813 void makeLayout( TQPainter &_painter, int _col, int _row );
828 TQValueList<Conditional> conditionList() const;
833 void setConditionList( const TQValueList<Conditional> &newList);
835 Validity * getValidity( int newStruct = -1 );
837 void removeValidity();
843 bool testValidity() const;
849 void calculateTextParameters( TQPainter &painter, int _col, int _row );
862 bool operator > ( const Cell & ) const;
863 bool operator < ( const Cell & ) const;
865 bool operator==( const Cell& other ) const;
866 inline bool operator!=( const Cell& other ) const { return !operator==( other ); }
868 void freeAllObscuredCells();
875 Flag_LayoutDirty = 0x00010000,
876 Flag_CalcDirty = 0x00020000,
877 Flag_Progress = 0x00040000,
878 Flag_UpdatingDeps = 0x00080000,
879 Flag_DisplayDirty = 0x00100000,
880 Flag_Merged = 0x00200000,
881 Flag_CellTooShortX = 0x00400000,
882 Flag_CellTooShortY = 0x00800000,
883 Flag_ParseError = 0x01000000,
884 Flag_CircularCalculation = 0x02000000,
885 Flag_DependancyError = 0x04000000,
886 Flag_PaintingCell = 0x08000000,
887 Flag_TextFormatDirty = 0x10000000
891 void clearFlag( CellFlags flag );
892 void setFlag( CellFlags flag );
893 bool testFlag( CellFlags flag ) const;
954 void applyZoomedFont( TQPainter &painter, int _col, int _row );
960 void textSize( TQPainter &_paint );
966 TQString textDisplaying( TQPainter &painter);
983 void checkTextInput();
989 void checkNumberFormat();
995 void loadOasisCellText( const TQDomElement& parent );
996 void loadOasisObjects( const TQDomElement& e, KoOasisLoadingContext& oasisContext );
997 void loadOasisValidation( const TQString& validationName );
999 void loadOasisValidationCondition( TQString &valExpression );
1000 void saveOasisAnnotation( KoXmlWriter &xmlwriter );
1001 void loadOasisConditional( TQDomElement * style );
1024 void paintCellBorders( TQPainter& painter, const KoRect &rect,
1025 const KoRect &cellRect,
1026 const TQPoint &cellRef,
1027 bool paintBorderRight, bool paintBorderBottom,
1028 bool paintBorderLeft, bool paintBorderTop,
1029 TQPen & rightPen, TQPen & bottomPen,
1030 TQPen & leftPen, TQPen & topPen );
1031 void paintPageBorders( TQPainter& painter, const KoRect &cellRect,
1032 const TQPoint &cellRef,
1033 bool paintBorderRight, bool paintBorderBottom );
1034 void paintText( TQPainter& painter, const KoRect &cellRect,
1035 const TQPoint &cellRef );
1036 void paintMoreTextIndicator( TQPainter& painter, const KoRect &cellRect,
1037 TQColor &backgroundColor );
1038 void paintCommentIndicator( TQPainter& painter, const KoRect &cellRect,
1039 const TQPoint &cellRef, TQColor &backgroundColor );
1040 void paintFormulaIndicator( TQPainter& painter, const KoRect &cellRect,
1041 TQColor &backgroundColor );
1042 void paintDefaultBorders( TQPainter& painter, const KoRect &rect,
1043 const KoRect &cellRect, const TQPoint &cellRef,
1044 bool paintBorderRight, bool paintBorderBottom,
1045 bool paintBorderLeft, bool paintBorderTop,
1046 TQPen const & rightPen, TQPen const & bottomPen,
1047 TQPen const & leftPen, TQPen const & topPen );
1048 void paintBackground( TQPainter& painter, const KoRect &cellRect,
1049 const TQPoint &cellRef, bool selected,
1050 TQColor &backgroundColor );
1051 void paintObscuredCells( const KoRect& rect, TQPainter& painter,
1052 View* view, const KoRect &cellRect,
1053 const TQPoint &cellRef,
1054 bool paintBorderRight, bool paintBorderBottom,
1055 bool paintBorderLeft, bool paintBorderTop,
1056 TQPen & rightPen, TQPen & bottomPen,
1057 TQPen & leftPen, TQPen & topPen,
1058 TQValueList<TQPoint> &mergedCellsPainted );
1059 void paintCellDiagonalLines( TQPainter& painter, const KoRect &cellRect,
1060 const TQPoint &cellRef );
1067 void valueChanged ();
1071 void setOutputText();
1075 bool loadCellData( const TQDomElement &text, Paste::Operation op);
1076 bool saveCellResult( TQDomDocument& doc, TQDomElement& result,
1086 void offsetAlign( int _col, int _row );
1088 void checkForNamedAreas( TQString & formula ) const;
1096 TQString convertFormulaToOasisFormat( const TQString & formula ) const;
1097 void loadOasisValidationValue( const TQStringList &listVal );
The canvas builds a part of the GUI of KSpread.
For every cell in the spread sheet there is a Cell object.
void NotifyDepending(int col, int row, Sheet *sheet, bool isDepending) Notify this cell that another cell is depending, or no longer depending on this cell's value.
Manages a set of conditions for a cell.
The Style class represents a cell style.
Provides a wrapper for cell value.
The View class displays a KSpread document.
Operation The current cell value treatment.
Type The type of the restriction.
|