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