00001 #ifndef KSPREAD_GLOBAL_H
00002 #define KSPREAD_GLOBAL_H
00003
00004 #include <qdatetime.h>
00005
00006 #include <kdebug.h>
00007 #include <kiconloader.h>
00008
00009 #include "kspread_factory.h"
00010
00011
00012 #define KS_rowMax 0x7FFF
00013
00014 #define KS_colMax 0x7FFF
00015
00016
00017 #define KS_spanMax 0xFFF
00018
00019
00020 namespace KSpread
00021 {
00022
00023 class ElapsedTime
00024 {
00025 public:
00026 enum OutputMode { Default, PrintOnlyTime };
00027 ElapsedTime()
00028 {
00029 m_time.start();
00030 }
00031
00032 ElapsedTime( QString const & name, OutputMode mode = Default )
00033 : m_name( name )
00034 {
00035 m_time.start();
00036 if ( mode != PrintOnlyTime )
00037 kdDebug() << "*** (" << name << ")... Starting measuring... " << endl;
00038 }
00039
00040 ~ElapsedTime()
00041 {
00042 uint milliSec = m_time.elapsed();
00043 uint min = (uint) ( milliSec / ( 1000 * 60 ) );
00044 milliSec -= ( min * 60 * 1000 );
00045 uint sec = (uint) ( milliSec / 1000 );
00046 milliSec -= sec * 1000;
00047
00048 if ( m_name.isNull() )
00049 kdDebug() << "*** Elapsed time: " << min << " min, " << sec << " sec, " << milliSec << " msec" << endl;
00050 else
00051 kdDebug() << "*** (" << m_name << ") Elapsed time " << min << " min, " << sec << " sec, " << milliSec << " msec" << endl;
00052 }
00053
00054 private:
00055 QTime m_time;
00056 QString m_name;
00057 };
00058
00063 namespace Paste
00064 {
00068 enum Mode
00069 {
00070 Normal ,
00071 Text ,
00072 Format ,
00073 NoBorder ,
00074 Comment ,
00075 Result ,
00076 NormalAndTranspose ,
00077 TextAndTranspose ,
00078 FormatAndTranspose ,
00079 NoBorderAndTranspose
00080 };
00084 enum Operation
00085 {
00086 OverWrite ,
00087 Add ,
00088 Mul ,
00089 Sub ,
00090 Div
00091 };
00092 }
00093
00098 namespace Restriction
00099 {
00103 enum Type
00104 {
00105 None ,
00106 Number ,
00107 Text ,
00108 Time ,
00109 Date ,
00110 Integer ,
00111 TextLength ,
00112 List
00113 };
00114 }
00115
00116 namespace Action
00117 {
00118 enum Type
00119 {
00120 Stop,
00121 Warning,
00122 Information
00123 };
00124 }
00125
00126 enum Series { Column,Row,Linear,Geometric };
00127
00128 enum MoveTo { Bottom, Left, Top, Right, BottomFirst };
00129 enum MethodOfCalc { SumOfNumber, Min, Max, Average, Count, NoneCalc, CountA };
00130
00131 enum FormatType {
00132 Generic_format=0,
00133 Number_format=1, Text_format=5, Money_format=10, Percentage_format=25,
00134 Scientific_format=30,
00135 ShortDate_format=35, TextDate_format=36, Time_format=50,
00136 SecondeTime_format=51,
00137 Time_format1=52, Time_format2=53, Time_format3=54, Time_format4=55,
00138 Time_format5=56, Time_format6=57, Time_format7=58, Time_format8=59,
00139 fraction_half=70,fraction_quarter=71,fraction_eighth=72,fraction_sixteenth=73,
00140 fraction_tenth=74,fraction_hundredth=75,fraction_one_digit=76,
00141 fraction_two_digits=77,fraction_three_digits=78,
00142 date_format1=200,date_format2=201,date_format3=202,date_format4=203,
00143 date_format5=204,date_format6=205,date_format7=206,date_format8=207,
00144 date_format9=208,date_format10=209,date_format11=210,date_format12=211,
00145 date_format13=212,date_format14=213,date_format15=214,date_format16=215,
00146 date_format17=216,date_format18=217,date_format19=218,date_format20=219,
00147 date_format21=220,date_format22=221,date_format23=222,date_format24=223,
00148 date_format25=224,date_format26=225,
00149 Custom_format = 300, No_format = 400
00150 };
00151
00152 enum ModifyType {
00153 MT_NONE = 0,
00154 MT_MOVE,
00155 MT_RESIZE_UP,
00156 MT_RESIZE_DN,
00157 MT_RESIZE_LF,
00158 MT_RESIZE_RT,
00159 MT_RESIZE_LU,
00160 MT_RESIZE_LD,
00161 MT_RESIZE_RU,
00162 MT_RESIZE_RD
00163 };
00164
00165 enum PropValue {
00166 STATE_ON = 0,
00167 STATE_OFF = 1,
00168 STATE_UNDEF = 2
00169 };
00170
00171
00172 enum ToolEditMode {
00173 TEM_MOUSE = 0,
00174
00175
00176
00177
00178 INS_OBJECT = 5,
00179
00180 INS_DIAGRAMM = 7,
00181
00182
00183
00184
00185
00186
00187
00188
00189 INS_PICTURE = 16
00190
00191
00192
00193
00194
00195
00196
00197 };
00198
00199
00200 }
00201
00202 #endif