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 class ElapsedTime
00012 {
00013 public:
00014 ElapsedTime()
00015 {
00016 m_time.start();
00017 }
00018
00019 ElapsedTime( QString const & name )
00020 : m_name( name )
00021 {
00022 m_time.start();
00023 kdDebug() << "*** (" << name << ")... Starting measuring... " << endl;
00024 }
00025
00026 ~ElapsedTime()
00027 {
00028 uint milliSec = m_time.elapsed();
00029 uint min = (uint) ( milliSec / ( 1000 * 60 ) );
00030 milliSec -= ( min * 60 * 1000 );
00031 uint sec = (uint) ( milliSec / 1000 );
00032 milliSec -= sec * 1000;
00033
00034 if ( m_name.isNull() )
00035 kdDebug() << "*** Elapsed time: " << min << " min, " << sec << " sec, " << milliSec << " msec" << endl;
00036 else
00037 kdDebug() << "*** (" << m_name << ") Elapsed time " << min << " min, " << sec << " sec, " << milliSec << " msec" << endl;
00038 }
00039
00040 private:
00041 QTime m_time;
00042 QString m_name;
00043 };
00044
00045
00046 #define KSBarIcon( x ) BarIcon( x, KSpreadFactory::global() )
00047 #define colWidth 60.0
00048 #define heightOfRow 20.0
00049
00050
00051 #define KS_rowMax 0x7FFF
00052
00053 #define KS_colMax 0x7FFF
00054
00055
00056
00057 #define KS_Max_Quad 0x8000
00058
00059
00060 #define KS_spanMax 0xFFF
00061
00062 enum PasteMode { Normal, Text, Format, NoBorder, Comment, Result, NormalAndTranspose, TextAndTranspoase,
00063 FormatAndTranspose, NoBorderAndTranspose };
00064 enum Operation { OverWrite, Add, Mul, Sub, Div };
00065 enum Conditional { None, Equal,Superior,Inferior,SuperiorEqual,InferiorEqual,Between,Different, DifferentTo};
00066 enum Action { Stop, Warning, Information};
00067 enum Allow { Allow_All, Allow_Number, Allow_Text,Allow_Time,Allow_Date,Allow_Integer,Allow_TextLength, Allow_List};
00068 enum Series { Column,Row,Linear,Geometric };
00069 namespace KSpread
00070 {
00071 enum MoveTo { Bottom, Left, Top, Right, BottomFirst };
00072 }
00073 enum MethodOfCalc { SumOfNumber, Min, Max, Average, Count, NoneCalc, CountA };
00074
00075 enum FormatType {
00076 Generic_format=0,
00077 Number_format=1, Text_format=5, Money_format=10, Percentage_format=25,
00078 Scientific_format=30,
00079 ShortDate_format=35, TextDate_format=36, Time_format=50,
00080 SecondeTime_format=51,
00081 Time_format1=52, Time_format2=53, Time_format3=54, Time_format4=55,
00082 Time_format5=56, Time_format6=57, Time_format7=58, Time_format8=59,
00083 fraction_half=70,fraction_quarter=71,fraction_eighth=72,fraction_sixteenth=73,
00084 fraction_tenth=74,fraction_hundredth=75,fraction_one_digit=76,
00085 fraction_two_digits=77,fraction_three_digits=78,
00086 date_format1=200,date_format2=201,date_format3=202,date_format4=203,
00087 date_format5=204,date_format6=205,date_format7=206,date_format8=207,
00088 date_format9=208,date_format10=209,date_format11=210,date_format12=211,
00089 date_format13=212,date_format14=213,date_format15=214,date_format16=215,
00090 date_format17=216,date_format18=217,date_format19=218,date_format20=219,
00091 date_format21=220,date_format22=221,date_format23=222,date_format24=223,
00092 date_format25=224,date_format26=225,
00093 Custom_format = 300
00094 };
00095
00096 #endif