-rw-r--r-- | libslcompat/slmisc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libslcompat/slmisc.h b/libslcompat/slmisc.h index 20ba988..442b098 100644 --- a/libslcompat/slmisc.h +++ b/libslcompat/slmisc.h | |||
@@ -1,135 +1,135 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 SHARP CORPORATION All rights reserved. | 2 | * Copyright (C) 2002 SHARP CORPORATION All rights reserved. |
3 | */ | 3 | */ |
4 | #ifndef _SLMISC_H_INCLUDED | 4 | #ifndef _SLMISC_H_INCLUDED |
5 | #define _SLMISC_H_INCLUDED | 5 | #define _SLMISC_H_INCLUDED |
6 | 6 | ||
7 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
8 | #include <qfileinfo.h> | 8 | #include <qfileinfo.h> |
9 | #include <qpe/global.h> | 9 | #include <qpe/global.h> |
10 | #include <qmessagebox.h> | 10 | #include <qmessagebox.h> |
11 | 11 | ||
12 | 12 | ||
13 | #define _SLPOWER | 13 | #define _SLPOWER |
14 | 14 | ||
15 | class QPopupMenu; | 15 | class QPopupMenu; |
16 | class QListView; | 16 | class QListView; |
17 | #if !defined(_SLPOWER) | 17 | #if !defined(_SLPOWER) |
18 | class PowerStatus; | 18 | class PowerStatus; |
19 | #else | 19 | #else |
20 | class SlPowerStatus; | 20 | class SlPowerStatus; |
21 | #endif | 21 | #endif |
22 | class Config; | 22 | class Config; |
23 | 23 | ||
24 | typedef ulong SlResolutionScale; | 24 | typedef ulong SlResolutionScale; |
25 | 25 | ||
26 | class SlMisc { | 26 | class SlMisc { |
27 | public: | 27 | public: |
28 | static bool isExecutable(const QString &c) { | 28 | static bool isExecutable(const QString &c) { |
29 | QFileInfo exec(QPEApplication::qpeDir() + "/bin/" + c); | 29 | QFileInfo exec(QPEApplication::qpeDir() + "bin/" + c); |
30 | return exec.isExecutable(); | 30 | return exec.isExecutable(); |
31 | }; | 31 | }; |
32 | static ulong availableMemory(); | 32 | static ulong availableMemory(); |
33 | static bool invalidFileName(QString &fName); | 33 | static bool invalidFileName(QString &fName); |
34 | static QString getValidFileName(const QString &baseName); | 34 | static QString getValidFileName(const QString &baseName); |
35 | static QString getCanonicalPath(const QString &fName); | 35 | static QString getCanonicalPath(const QString &fName); |
36 | static void enableAutoPowerOff(bool isOn); | 36 | static void enableAutoPowerOff(bool isOn); |
37 | static void enableAutoPowerOff(bool isOn,bool DimAlso,bool ScreenSaverAlso=FALSE); | 37 | static void enableAutoPowerOff(bool isOn,bool DimAlso,bool ScreenSaverAlso=FALSE); |
38 | static void enableLockApplication(bool); | 38 | static void enableLockApplication(bool); |
39 | static bool isTheSmbShareFileHasWriteEntry(const QString &shareFName); | 39 | static bool isTheSmbShareFileHasWriteEntry(const QString &shareFName); |
40 | static bool isTheSmbShareFileNowCopy(const QString &shareFName); | 40 | static bool isTheSmbShareFileNowCopy(const QString &shareFName); |
41 | static bool checkTheSmbShareFileMode(const QString &shareFName, | 41 | static bool checkTheSmbShareFileMode(const QString &shareFName, |
42 | char modeMask, char checkMode, bool equality); | 42 | char modeMask, char checkMode, bool equality); |
43 | static bool isTheFileLockedBySmbd(const QString &fName); | 43 | static bool isTheFileLockedBySmbd(const QString &fName); |
44 | static bool isSambaForked(); | 44 | static bool isSambaForked(); |
45 | static void startSamba(); | 45 | static void startSamba(); |
46 | static void stopSamba(); | 46 | static void stopSamba(); |
47 | enum ListType { Pid, CmdLine, Both }; | 47 | enum ListType { Pid, CmdLine, Both }; |
48 | static QStringList procList (const QRegExp& re, uint max = 0, enum ListType type = Pid); | 48 | static QStringList procList (const QRegExp& re, uint max = 0, enum ListType type = Pid); |
49 | static void dumpMemInfo(bool isShowHeap); | 49 | static void dumpMemInfo(bool isShowHeap); |
50 | static bool canCreateTheFile(const QString&); | 50 | static bool canCreateTheFile(const QString&); |
51 | static QString getLanguage(); | 51 | static QString getLanguage(); |
52 | static QSize getMaximizedWidgetInfo(); | 52 | static QSize getMaximizedWidgetInfo(); |
53 | static QSize SlMisc::getScrollbarMetrics(); | 53 | static QSize SlMisc::getScrollbarMetrics(); |
54 | static int getDpi(); | 54 | static int getDpi(); |
55 | static SlResolutionScale getResolutionScale(); | 55 | static SlResolutionScale getResolutionScale(); |
56 | static int getMaximizedWidgetContentsWidth(); | 56 | static int getMaximizedWidgetContentsWidth(); |
57 | static bool isLandscape(); | 57 | static bool isLandscape(); |
58 | static void requestCloseFile(const QString&); | 58 | static void requestCloseFile(const QString&); |
59 | static void requestOpenFile(const QString&); | 59 | static void requestOpenFile(const QString&); |
60 | 60 | ||
61 | static void insertStandardFontMenu(QPopupMenu *pm); | 61 | static void insertStandardFontMenu(QPopupMenu *pm); |
62 | static void insertAllFontMenu(QPopupMenu *pm); | 62 | static void insertAllFontMenu(QPopupMenu *pm); |
63 | static int getLogicalSizeFromMenuId(int id); | 63 | static int getLogicalSizeFromMenuId(int id); |
64 | static void setFontSizeItemChecked(QPopupMenu *pm,int logicalSize); | 64 | static void setFontSizeItemChecked(QPopupMenu *pm,int logicalSize); |
65 | static int getFontPointSize(int logicalSize); | 65 | static int getFontPointSize(int logicalSize); |
66 | static void toggleFontSize(QPopupMenu *pm,int &logicalSize,bool isLarge=true); | 66 | static void toggleFontSize(QPopupMenu *pm,int &logicalSize,bool isLarge=true); |
67 | static void toggleAllFontSize(QPopupMenu *pm,int *fontSize,bool isLarge=true); | 67 | static void toggleAllFontSize(QPopupMenu *pm,int *fontSize,bool isLarge=true); |
68 | 68 | ||
69 | static void SlFontArrange (QWidget* widget); | 69 | static void SlFontArrange (QWidget* widget); |
70 | static void SlLayoutSpaceArrange (QObject* object); | 70 | static void SlLayoutSpaceArrange (QObject* object); |
71 | 71 | ||
72 | static bool checkBatteryError(const QString &module_name, bool force); | 72 | static bool checkBatteryError(const QString &module_name, bool force); |
73 | static bool checkBatteryErrorWithoutDialog(const QString &module_name, bool force); | 73 | static bool checkBatteryErrorWithoutDialog(const QString &module_name, bool force); |
74 | 74 | ||
75 | 75 | ||
76 | enum InputDeviceType { | 76 | enum InputDeviceType { |
77 | BuiltinKeyboard = 1, | 77 | BuiltinKeyboard = 1, |
78 | SoftwareKeyboard = 2 | 78 | SoftwareKeyboard = 2 |
79 | }; | 79 | }; |
80 | static InputDeviceType defaultInputDevice(); | 80 | static InputDeviceType defaultInputDevice(); |
81 | 81 | ||
82 | 82 | ||
83 | typedef struct SlListColumnInfo { | 83 | typedef struct SlListColumnInfo { |
84 | enum Type { | 84 | enum Type { |
85 | Fixed = 0, | 85 | Fixed = 0, |
86 | StringLen, | 86 | StringLen, |
87 | Scale, | 87 | Scale, |
88 | FixedDpiAware | 88 | FixedDpiAware |
89 | }; | 89 | }; |
90 | Type type; | 90 | Type type; |
91 | QString str; | 91 | QString str; |
92 | int val; | 92 | int val; |
93 | }; | 93 | }; |
94 | typedef QValueList<SlListColumnInfo> SlListColumnInfos; | 94 | typedef QValueList<SlListColumnInfo> SlListColumnInfos; |
95 | 95 | ||
96 | static void setListColumnsWidth(QWidget *w,SlListColumnInfos &infos, | 96 | static void setListColumnsWidth(QWidget *w,SlListColumnInfos &infos, |
97 | Config &config); | 97 | Config &config); |
98 | static void writeListColumnsWidth(QWidget *w,SlListColumnInfos &infos, | 98 | static void writeListColumnsWidth(QWidget *w,SlListColumnInfos &infos, |
99 | Config &config); | 99 | Config &config); |
100 | static void writeListColumnsWidth(QWidget *w,SlListColumnInfos &infos, | 100 | static void writeListColumnsWidth(QWidget *w,SlListColumnInfos &infos, |
101 | Config &config,bool isLandscape); | 101 | Config &config,bool isLandscape); |
102 | static void rotateListColumnsWidth(QWidget *w,SlListColumnInfos &infos, | 102 | static void rotateListColumnsWidth(QWidget *w,SlListColumnInfos &infos, |
103 | Config &config); | 103 | Config &config); |
104 | static void setListColumnsWidth(QWidget *w,SlListColumnInfos &infos, Config *config=NULL); | 104 | static void setListColumnsWidth(QWidget *w,SlListColumnInfos &infos, Config *config=NULL); |
105 | static void writeListColumnsWidth(QWidget *w,SlListColumnInfos &infos, Config *config=NULL); | 105 | static void writeListColumnsWidth(QWidget *w,SlListColumnInfos &infos, Config *config=NULL); |
106 | static void writeListColumnsWidth(QWidget *w,SlListColumnInfos &infos, bool isLandscape, Config *config=NULL); | 106 | static void writeListColumnsWidth(QWidget *w,SlListColumnInfos &infos, bool isLandscape, Config *config=NULL); |
107 | static void rotateListColumnsWidth(QWidget *w,SlListColumnInfos &infos, Config *config=NULL); | 107 | static void rotateListColumnsWidth(QWidget *w,SlListColumnInfos &infos, Config *config=NULL); |
108 | static void temporaryMessageBox(const QString &caption, const QString &text, int msec=10000, QMessageBox::Icon icon=QMessageBox::NoIcon, int button0=0, int button1=0, int button2=0, QWidget *parent=0, const char *name=0, QWidget::WFlags f=QWidget::WStyle_DialogBorder); | 108 | static void temporaryMessageBox(const QString &caption, const QString &text, int msec=10000, QMessageBox::Icon icon=QMessageBox::NoIcon, int button0=0, int button1=0, int button2=0, QWidget *parent=0, const char *name=0, QWidget::WFlags f=QWidget::WStyle_DialogBorder); |
109 | 109 | ||
110 | static QString defaultWallPaper(); | 110 | static QString defaultWallPaper(); |
111 | typedef enum AppCommand { | 111 | typedef enum AppCommand { |
112 | NoneCommand = 0, | 112 | NoneCommand = 0, |
113 | NewCommand, | 113 | NewCommand, |
114 | ModifyCommand, | 114 | ModifyCommand, |
115 | DeleteCommand, | 115 | DeleteCommand, |
116 | ZoomInCommand, | 116 | ZoomInCommand, |
117 | ZoomOutCommand, | 117 | ZoomOutCommand, |
118 | CutCommand = 50, | 118 | CutCommand = 50, |
119 | CopyCommand, | 119 | CopyCommand, |
120 | PasteCommand | 120 | PasteCommand |
121 | }; | 121 | }; |
122 | static AppCommand appCommandFromKey(const QKeyEvent &e); | 122 | static AppCommand appCommandFromKey(const QKeyEvent &e); |
123 | 123 | ||
124 | typedef enum RequiredSize { | 124 | typedef enum RequiredSize { |
125 | SmallSize = 0, | 125 | SmallSize = 0, |
126 | LargeSize | 126 | LargeSize |
127 | }; | 127 | }; |
128 | static const char* getTmpPath(RequiredSize); | 128 | static const char* getTmpPath(RequiredSize); |
129 | static const char* getTmpPath(ulong); | 129 | static const char* getTmpPath(ulong); |
130 | static QString getObexTmpPath(); | 130 | static QString getObexTmpPath(); |
131 | static ulong availableInternalStorage(void); | 131 | static ulong availableInternalStorage(void); |
132 | static QString moduleNameFromPath(const QString &path); | 132 | static QString moduleNameFromPath(const QString &path); |
133 | }; | 133 | }; |
134 | 134 | ||
135 | #endif | 135 | #endif |