Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

LgiCommon.h

Go to the documentation of this file.
00001 
00009 #ifndef _LGI_COMMON_H
00010 #define _LGI_COMMON_H
00011 
00012 #if defined LINUX
00013 #include <sys/time.h>
00014 #endif
00015 
00016 #include "GArray.h"
00017 
00018 #ifdef __cplusplus
00019 extern "C"
00020 {
00021 #endif
00022 
00024 // Externs
00025 
00026 // Codepages
00027 
00029 LgiFunc int LgiBufConvertCp(void *Out, char *OutCp, int OutLen, void *&In, char *InCp, int &InLen);
00032 LgiFunc void *LgiNewConvertCp
00033 (
00035     char *OutCp,
00037     void *In,
00039     char *InCp,
00041     int InLen = -1
00042 );
00044 LgiFunc char16 *LgiNewUtf8To16(char *In, int InLen = -1);
00046 LgiFunc char *LgiNewUtf16To8
00047 (
00049     char16 *In,
00051     int InLen = -1
00052 );
00054 LgiFunc bool LgiIsCpImplemented(char *Cp);
00056 LgiFunc char *LgiAnsiToLgiCp(int AnsiCodePage = -1);
00058 LgiFunc char *LgiDetectCharset
00059 (
00061     char *Utf8,
00063     int Len = -1,
00065     List<char> *Prefs = 0
00066 );
00068 LgiFunc int LgiByteLen(void *Str, char *Cp);
00070 LgiFunc int LgiCharLen(void *Str, char *Cp, int Bytes = -1);
00072 LgiFunc char *LgiSeekUtf8
00073 (
00075     char *Ptr,
00077     int D,
00079     char *Start = 0
00080 );
00082 LgiFunc bool LgiIsUtf8(char *s, int len = -1);
00084 LgiFunc char *LgiToNativeCp(char *In, int InLen = -1);
00086 LgiFunc char *LgiFromNativeCp(char *In, int InLen = -1);
00088 LgiFunc char *LgiTokStr(char *&s);
00090 LgiFunc void LgiFormatSize
00091 (
00093     char *Str,
00095     uint64 Size
00096 );
00099 LgiFunc char *LgiDecodeUri
00100 (
00102     char *uri,
00104     int len = -1
00105 );
00108 LgiFunc char *LgiEncodeUri
00109 (
00111     char *uri,
00113     int len = -1
00114 );
00115 
00116 // Path
00117 
00119 LgiFunc bool LgiGetExeFile(char *Dst, int DstSize);
00121 LgiFunc bool LgiGetExePath(char *Dst, int DstSize);
00123 LgiFunc bool LgiGetTempPath(char *Dst, int DstSize);
00124 
00127 enum LgiSystemPath
00128 {
00130     LSP_OS,
00132     LSP_OS_LIB,
00134     LSP_TEMP,
00136     LSP_APP_DATA,
00138     LSP_LOCAL_APP_DATA,
00140     LSP_DESKTOP,
00142     LSP_HOME,
00144     LSP_EXE,
00146     LSP_TRASH
00147 };
00149 LgiFunc bool LgiGetSystemPath
00150 (
00152     LgiSystemPath Which,
00154     char *Dst,
00156     int DstSize
00157 );
00159 LgiFunc char *LgiFindFile(char *Name);
00160 
00162 typedef bool (*RecursiveFileSearch_Callback)(char *Path, class GDirectory *Dir);
00165 LgiFunc bool LgiRecursiveFileSearch
00166 (
00168     char *Root,
00170     List<char> *Ext = 0,
00172     List<char> *Files = 0,
00174     uint64 *Size = 0,
00176     uint64 *Count = 0,
00178     RecursiveFileSearch_Callback Callback = 0
00179 );
00180 
00181 // Resources
00182 
00184 LgiFunc struct GLanguage *LgiGetLanguageId();
00186 LgiFunc char *LgiLoadString(int Res, char *Default = 0);
00187 
00188 // Os version functions
00189 
00192 LgiFunc int LgiGetOs(int *Ver = 0, int *Rev = 0);
00194 LgiFunc char *LgiGetOsName();
00195 
00196 // System
00197 
00205 LgiFunc bool LgiExecute
00206 (
00208     char *File,
00210     char *Arguments="",
00212     char *Dir="."
00213 );
00214 
00216 LgiFunc void LgiRandomize(uint Seed);
00217 
00219 LgiFunc uint LgiRand(uint Max = 0);
00220 
00221 LgiFunc void _lgi_read_colour_config(char *Tag, uint32 *c);
00222 
00224 LgiFunc bool LgiPlaySound
00225 (
00227     char *FileName,
00229     int Flags
00230 );
00232 LgiFunc bool LgiGetFileMimeType
00233 (
00235     char *File,
00237     char *Mime,
00239     int MimeBufSize
00240 );
00241 
00243 LgiFunc bool LgiGetAppForMimeType
00244 (
00246     char *Mime,
00248     char *AppPath,
00250     int BufSize
00251 );
00252 
00254 class GAppInfo
00255 {
00256 public:
00258     char *Path;
00260     char *Name;
00262     char *Icon;
00263     
00264     GAppInfo()
00265     {
00266         Path = 0;
00267         Name = 0;
00268         Icon = 0;
00269     }
00270     
00271     ~GAppInfo()
00272     {
00273         DeleteArray(Path);
00274         DeleteArray(Name);
00275         DeleteArray(Icon);
00276     }
00277 };
00278 
00280 LgiFunc bool LgiGetAppsForMimeType
00281 (
00283     char *Mime,
00285     GArray<GAppInfo*> &Apps,
00288     int Limit = -1
00289 );
00290 
00292 LgiFunc uint64 LgiCurrentTime();
00293 
00294 // Debug
00295 
00297 LgiFunc void LgiTrace(char *Format, ...);
00299 LgiFunc int LgiIsReleaseBuild();
00300 
00301 #if defined WIN32
00302 
00304 LgiFunc bool RegisterActiveXControl(char *Dll);
00305 
00306 #elif defined LINUX
00307 
00309 enum WindowManager
00310 {
00311     WM_Unknown,
00312     WM_Kde,
00313     WM_Gnome
00314 };
00315 
00317 WindowManager LgiGetWindowManager();
00318 
00319 #endif
00320 
00321 #ifdef __cplusplus
00322 }
00323 #endif
00324 
00325 #endif

Generated on Wed Oct 26 14:46:50 2005 for Lgi by  doxygen 1.4.1