KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
4.9KB

  1. #ifndef KSPREAD_GLOBAL_H
  2. #define KSPREAD_GLOBAL_H
  3. #include <tqdatetime.h>
  4. #include <kdebug.h>
  5. #include <kiconloader.h>
  6. #include "kspread_factory.h"
  7. /* Definition of maximal supported rows - please check kspread_util (columnName) and kspread_cluster also */
  8. #define KS_rowMax 0x7FFF
  9. /* Definition of maximal supported columns - please check kspread_util (columnName) and kspread_cluster also */
  10. #define KS_colMax 0x7FFF
  11. /* Definition of maximal supported columns/rows, which can be merged */
  12. #define KS_spanMax 0xFFF
  13. namespace KSpread
  14. {
  15. class ElapsedTime
  16. {
  17. public:
  18. enum OutputMode { Default, PrintOnlyTime };
  19. ElapsedTime()
  20. {
  21. m_time.start();
  22. }
  23. ElapsedTime( TQString const & name, OutputMode mode = Default )
  24. : m_name( name )
  25. {
  26. m_time.start();
  27. if ( mode != PrintOnlyTime )
  28. kdDebug() << "*** (" << name << ")... Starting measuring... " << endl;
  29. }
  30. ~ElapsedTime()
  31. {
  32. uint milliSec = m_time.elapsed();
  33. uint min = (uint) ( milliSec / ( 1000 * 60 ) );
  34. milliSec -= ( min * 60 * 1000 );
  35. uint sec = (uint) ( milliSec / 1000 );
  36. milliSec -= sec * 1000;
  37. if ( m_name.isNull() )
  38. kdDebug() << "*** Elapsed time: " << min << " min, " << sec << " sec, " << milliSec << " msec" << endl;
  39. else
  40. kdDebug() << "*** (" << m_name << ") Elapsed time " << min << " min, " << sec << " sec, " << milliSec << " msec" << endl;
  41. }
  42. private:
  43. TQTime m_time;
  44. TQString m_name;
  45. };
  46. /**
  47. * This namespace collects enumerations related to
  48. * pasting operations.
  49. */
  50. namespace Paste
  51. {
  52. /**
  53. * The pasted content
  54. */
  55. enum Mode
  56. {
  57. Normal /** Everything */,
  58. Text /** Text only */,
  59. Format /** Format only */,
  60. NoBorder /** not the borders */,
  61. Comment /** Comment only */,
  62. Result /** Result only, no formula */,
  63. NormalAndTranspose /** */,
  64. TextAndTranspose /** */,
  65. FormatAndTranspose /** */,
  66. NoBorderAndTranspose /** */
  67. };
  68. /**
  69. * The current cell value treatment.
  70. */
  71. enum Operation
  72. {
  73. OverWrite /** Overwrite */,
  74. Add /** Add */,
  75. Mul /** Multiply */,
  76. Sub /** Substract */,
  77. Div /** Divide */
  78. };
  79. } // namespace Paste
  80. /**
  81. * This namespace collects enumerations related to
  82. * cell content restrictions.
  83. */
  84. namespace Restriction
  85. {
  86. /**
  87. * The type of the restriction
  88. */
  89. enum Type
  90. {
  91. None /** No restriction */,
  92. Number /** Restrict to numbers */,
  93. Text /** Restrict to texts */,
  94. Time /** Restrict to times */,
  95. Date /** Restrict to dates */,
  96. Integer /** Restrict to integers */,
  97. TextLength /** Restrict text length */,
  98. List /** Restrict to lists */
  99. };
  100. } // namespace Restriction
  101. namespace Action
  102. {
  103. enum Type
  104. {
  105. Stop,
  106. Warning,
  107. Information
  108. };
  109. }
  110. enum Series { Column,Row,Linear,Geometric };
  111. // necessary due to TQDock* enums (Werner)
  112. enum MoveTo { Bottom, Left, Top, Right, BottomFirst };
  113. enum MethodOfCalc { SumOfNumber, Min, Max, Average, Count, NoneCalc, CountA };
  114. enum FormatType {
  115. Generic_format=0,
  116. Number_format=1, Text_format=5, Money_format=10, Percentage_format=25,
  117. Scientific_format=30,
  118. ShortDate_format=35, TextDate_format=36, Time_format=50,
  119. SecondeTime_format=51,
  120. Time_format1=52, Time_format2=53, Time_format3=54, Time_format4=55,
  121. Time_format5=56, Time_format6=57, Time_format7=58, Time_format8=59,
  122. fraction_half=70,fraction_quarter=71,fraction_eighth=72,fraction_sixteenth=73,
  123. fraction_tenth=74,fraction_hundredth=75,fraction_one_digit=76,
  124. fraction_two_digits=77,fraction_three_digits=78,
  125. date_format1=200,date_format2=201,date_format3=202,date_format4=203,
  126. date_format5=204,date_format6=205,date_format7=206,date_format8=207,
  127. date_format9=208,date_format10=209,date_format11=210,date_format12=211,
  128. date_format13=212,date_format14=213,date_format15=214,date_format16=215,
  129. date_format17=216,date_format18=217,date_format19=218,date_format20=219,
  130. date_format21=220,date_format22=221,date_format23=222,date_format24=223,
  131. date_format25=224,date_format26=225,
  132. Custom_format = 300, No_format = 400
  133. };
  134. enum ModifyType {
  135. MT_NONE = 0,
  136. MT_MOVE,
  137. MT_RESIZE_UP,
  138. MT_RESIZE_DN,
  139. MT_RESIZE_LF,
  140. MT_RESIZE_RT,
  141. MT_RESIZE_LU,
  142. MT_RESIZE_LD,
  143. MT_RESIZE_RU,
  144. MT_RESIZE_RD
  145. };
  146. enum PropValue {
  147. STATE_ON = 0,
  148. STATE_OFF = 1,
  149. STATE_UNDEF = 2
  150. };
  151. //TODO Implement all objects :)
  152. enum ToolEditMode {
  153. TEM_MOUSE = 0,
  154. //INS_RECT = 1,
  155. //INS_ELLIPSE = 2,
  156. //INS_TEXT = 3,
  157. //INS_PIE = 4,
  158. INS_OBJECT = 5,
  159. //INS_LINE = 6,
  160. INS_DIAGRAMM = 7,
  161. //INS_TABLE = 8,
  162. //INS_FORMULA = 9,
  163. //INS_AUTOFORM = 10,
  164. //INS_FREEHAND = 11,
  165. //INS_POLYLINE = 12,
  166. //INS_QUADRICBEZIERCURVE = 13,
  167. //INS_CUBICBEZIERCURVE = 14,
  168. //INS_POLYGON = 15,
  169. INS_PICTURE = 16
  170. //INS_CLIPART = 17,
  171. //TEM_ROTATE = 18,
  172. //TEM_ZOOM = 19,
  173. //INS_CLOSED_FREEHAND = 20,
  174. //INS_CLOSED_POLYLINE = 21,
  175. //INS_CLOSED_QUADRICBEZIERCURVE = 22,
  176. //INS_CLOSED_CUBICBEZIERCURVE = 23
  177. };
  178. } // namespace KSpread
  179. #endif