kspread

kspread_global.h

00001 #ifndef KSPREAD_GLOBAL_H
00002 #define KSPREAD_GLOBAL_H
00003 
00004 #include <kiconloader.h>
00005 
00006 #include "kspread_factory.h"
00007 
00008 #include <qdatetime.h>
00009 #include <kdebug.h>
00010 
00011 
00012 #define KSBarIcon( x ) BarIcon( x, Factory::global() )
00013 #define colWidth 60.0
00014 #define heightOfRow 20.0
00015 
00016 /* Definition of maximal supported rows - please check kspread_util (columnName) and kspread_cluster also */
00017 #define KS_rowMax 0x7FFF
00018 /* Definition of maximal supported columns - please check kspread_util (columnName) and kspread_cluster also */
00019 #define KS_colMax 0x7FFF
00020 
00021 /* Currently used by StyleCluster for the Quad tree - question is, if we can make the spreadsheet this big in general?
00022    We need this value to be the smallest number which is a power of 2 and more than both KS_rowMax and KS_colMax*/
00023 #define KS_Max_Quad 0x8000
00024 
00025 /* Definition of maximal supported columns/rows, which can be merged */
00026 #define KS_spanMax 0xFFF
00027 
00028 
00029 namespace KSpread
00030 {
00031 
00032 class ElapsedTime
00033 {
00034  public:
00035   ElapsedTime()
00036   {
00037     m_time.start();
00038   }
00039 
00040   ElapsedTime( QString const & name )
00041     : m_name( name )
00042   {
00043     m_time.start();
00044     kdDebug() << "*** (" << name << ")... Starting measuring... " << endl;
00045   }
00046 
00047   ~ElapsedTime()
00048   {
00049     uint milliSec = m_time.elapsed();
00050     uint min = (uint) ( milliSec / ( 1000 * 60 ) );
00051     milliSec -= ( min * 60 * 1000 );
00052     uint sec = (uint) ( milliSec / 1000 );
00053     milliSec -= sec * 1000;
00054 
00055     if ( m_name.isNull() )
00056       kdDebug() << "*** Elapsed time: " << min << " min, " << sec << " sec, " << milliSec << " msec" << endl;
00057     else
00058       kdDebug() << "*** (" << m_name << ") Elapsed time " << min << " min, " << sec << " sec, " << milliSec << " msec" << endl;
00059   }
00060 
00061  private:
00062   QTime   m_time;
00063   QString m_name;
00064 };
00065 
00070 namespace Paste
00071 {
00075   enum Mode
00076   {
00077     Normal ,
00078     Text ,
00079     Format ,
00080     NoBorder ,
00081     Comment ,
00082     Result ,
00083     NormalAndTranspose ,
00084     TextAndTranspose ,
00085     FormatAndTranspose ,
00086     NoBorderAndTranspose 
00087   };
00091   enum Operation
00092   {
00093     OverWrite ,
00094     Add ,
00095     Mul ,
00096     Sub ,
00097     Div 
00098   };
00099 } // namespace Paste
00100 
00105 namespace Restriction
00106 {
00110   enum Type
00111   {
00112     None ,
00113     Number ,
00114     Text ,
00115     Time ,
00116     Date ,
00117     Integer ,
00118     TextLength ,
00119     List 
00120   };
00121 } // namespace Restriction
00122 
00123 namespace Action
00124 {
00125   enum Type
00126   {
00127     Stop,
00128     Warning,
00129     Information
00130   };
00131 }
00132 
00133 enum Series { Column,Row,Linear,Geometric };
00134 // necessary due to QDock* enums (Werner)
00135 enum MoveTo { Bottom, Left, Top, Right, BottomFirst };
00136 enum MethodOfCalc { SumOfNumber, Min, Max, Average, Count, NoneCalc, CountA };
00137 
00138 enum FormatType {
00139     Generic_format=0,
00140     Number_format=1, Text_format=5, Money_format=10, Percentage_format=25,
00141     Scientific_format=30,
00142     ShortDate_format=35, TextDate_format=36, Time_format=50,
00143     SecondeTime_format=51,
00144     Time_format1=52, Time_format2=53, Time_format3=54, Time_format4=55,
00145     Time_format5=56, Time_format6=57, Time_format7=58, Time_format8=59,
00146     fraction_half=70,fraction_quarter=71,fraction_eighth=72,fraction_sixteenth=73,
00147     fraction_tenth=74,fraction_hundredth=75,fraction_one_digit=76,
00148     fraction_two_digits=77,fraction_three_digits=78,
00149     date_format1=200,date_format2=201,date_format3=202,date_format4=203,
00150     date_format5=204,date_format6=205,date_format7=206,date_format8=207,
00151     date_format9=208,date_format10=209,date_format11=210,date_format12=211,
00152     date_format13=212,date_format14=213,date_format15=214,date_format16=215,
00153     date_format17=216,date_format18=217,date_format19=218,date_format20=219,
00154     date_format21=220,date_format22=221,date_format23=222,date_format24=223,
00155     date_format25=224,date_format26=225,
00156     Custom_format = 300, No_format = 400
00157 };
00158 
00159 enum ModifyType {
00160   MT_NONE = 0,
00161   MT_MOVE,
00162   MT_RESIZE_UP,
00163   MT_RESIZE_DN,
00164   MT_RESIZE_LF,
00165   MT_RESIZE_RT,
00166   MT_RESIZE_LU,
00167   MT_RESIZE_LD,
00168   MT_RESIZE_RU,
00169   MT_RESIZE_RD
00170 };
00171 
00172 enum PropValue {
00173     STATE_ON = 0,
00174     STATE_OFF = 1,
00175     STATE_UNDEF = 2
00176 };
00177 
00178 //TODO Implement all objects :)
00179 enum ToolEditMode {
00180     TEM_MOUSE = 0,
00181     //INS_RECT = 1,
00182     //INS_ELLIPSE = 2,
00183     //INS_TEXT = 3,
00184     //INS_PIE = 4,
00185     INS_OBJECT = 5,
00186     //INS_LINE = 6,
00187     INS_DIAGRAMM = 7,
00188     //INS_TABLE = 8,
00189     //INS_FORMULA = 9,
00190     //INS_AUTOFORM = 10,
00191     //INS_FREEHAND = 11,
00192     //INS_POLYLINE = 12,
00193     //INS_QUADRICBEZIERCURVE = 13,
00194     //INS_CUBICBEZIERCURVE = 14,
00195     //INS_POLYGON = 15,
00196     INS_PICTURE = 16
00197     //INS_CLIPART = 17,
00198     //TEM_ROTATE = 18,
00199     //TEM_ZOOM = 19,
00200     //INS_CLOSED_FREEHAND = 20,
00201     //INS_CLOSED_POLYLINE = 21,
00202     //INS_CLOSED_QUADRICBEZIERCURVE = 22,
00203     //INS_CLOSED_CUBICBEZIERCURVE = 23
00204 };
00205 
00206 
00207 } // namespace KSpread
00208 
00209 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys