Back to index

lightning-sunbird  0.9+nobinonly
xpcom_consts.py
Go to the documentation of this file.
00001 # ***** BEGIN LICENSE BLOCK *****
00002 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003 #
00004 # The contents of this file are subject to the Mozilla Public License Version
00005 # 1.1 (the "License"); you may not use this file except in compliance with
00006 # the License. You may obtain a copy of the License at
00007 # http://www.mozilla.org/MPL/
00008 #
00009 # Software distributed under the License is distributed on an "AS IS" basis,
00010 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011 # for the specific language governing rights and limitations under the
00012 # License.
00013 #
00014 # The Original Code is the Python XPCOM language bindings.
00015 #
00016 # The Initial Developer of the Original Code is
00017 # ActiveState Tool Corp.
00018 # Portions created by the Initial Developer are Copyright (C) 2000, 2001
00019 # the Initial Developer. All Rights Reserved.
00020 #
00021 # Contributor(s):
00022 #   Mark Hammond <mhammond@skippinet.com.au> (original author)
00023 #
00024 # Alternatively, the contents of this file may be used under the terms of
00025 # either the GNU General Public License Version 2 or later (the "GPL"), or
00026 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027 # in which case the provisions of the GPL or the LGPL are applicable instead
00028 # of those above. If you wish to allow use of your version of this file only
00029 # under the terms of either the GPL or the LGPL, and not to allow others to
00030 # use your version of this file under the terms of the MPL, indicate your
00031 # decision by deleting the provisions above and replace them with the notice
00032 # and other provisions required by the GPL or the LGPL. If you do not delete
00033 # the provisions above, a recipient may use your version of this file under
00034 # the terms of any one of the MPL, the GPL or the LGPL.
00035 #
00036 # ***** END LICENSE BLOCK *****
00037 
00038 # Could maybe later have a process that extracted these enums should they change.
00039 # from nsFileLocations.h
00040 App_DirectoryBase              = 0x00010000
00041 App_PrefsDirectory30           = App_DirectoryBase +    1 
00042 App_PrefsDirectory40           = App_DirectoryBase +    2
00043 App_PrefsDirectory50           = App_DirectoryBase +    3
00044 App_ResDirectory               = App_DirectoryBase +    5
00045 App_UserProfileDirectory30     = App_DirectoryBase +   10
00046 App_UserProfileDirectory40     = App_DirectoryBase +   11
00047 App_UserProfileDirectory50     = App_DirectoryBase +   12
00048 App_DefaultUserProfileRoot30   = App_DirectoryBase +   13
00049 App_DefaultUserProfileRoot40   = App_DirectoryBase +   14
00050 App_DefaultUserProfileRoot50   = App_DirectoryBase +   15
00051 App_ProfileDefaultsFolder30    = App_DirectoryBase +   16
00052 App_ProfileDefaultsFolder40    = App_DirectoryBase +   17
00053 App_ProfileDefaultsFolder50    = App_DirectoryBase +   18
00054 App_PrefDefaultsFolder50       = App_DirectoryBase +   19
00055 App_DefaultsFolder50           = App_DirectoryBase +   25
00056 App_ComponentsDirectory        = App_DirectoryBase +   30
00057 App_ChromeDirectory            = App_DirectoryBase +   31
00058 App_PluginsDirectory           = App_DirectoryBase +   32
00059 App_UserChromeDirectory        = App_DirectoryBase +   40
00060 App_FileBase                   = App_DirectoryBase + 1000
00061 App_PreferencesFile30          = App_FileBase      +    1
00062 App_PreferencesFile40          = App_FileBase      +    2
00063 App_PreferencesFile50          = App_FileBase      +    3
00064 App_BookmarksFile30            = App_FileBase      +   10
00065 App_BookmarksFile40            = App_FileBase      +   11
00066 App_BookmarksFile50            = App_FileBase      +   12
00067 App_Registry40                 = App_FileBase      +   20
00068 App_Registry50                 = App_FileBase      +   21
00069 App_LocalStore50               = App_FileBase   +  30
00070 App_History50              = App_FileBase   +  40
00071 App_MailDirectory50        = App_FileBase   +  50
00072 App_ImapMailDirectory50    = App_FileBase   +  60
00073 App_NewsDirectory50        = App_FileBase   +  70
00074 App_MessengerFolderCache50 = App_FileBase   +  80
00075 App_UsersPanels50          = App_FileBase   +  90
00076 App_SearchFile50           = App_FileBase   + 100
00077 App_SearchDirectory50      = App_FileBase   + 101
00078 
00079 # From nsSpecialSystemDirectory.h
00080 OS_DriveDirectory         =   1
00081 OS_TemporaryDirectory     =   2
00082 OS_CurrentProcessDirectory=   3
00083 OS_CurrentWorkingDirectory=   4
00084 
00085 XPCOM_CurrentProcessComponentDirectory=   5
00086 XPCOM_CurrentProcessComponentRegistry=   6            
00087 
00088 Moz_BinDirectory          = 10
00089 
00090 Mac_SystemDirectory       =   101
00091 Mac_DesktopDirectory      =   102
00092 Mac_TrashDirectory        =   103
00093 Mac_StartupDirectory      =   104
00094 Mac_ShutdownDirectory     =   105
00095 Mac_AppleMenuDirectory    =   106
00096 Mac_ControlPanelDirectory =   107
00097 Mac_ExtensionDirectory    =   108
00098 Mac_FontsDirectory        =   109
00099 Mac_PreferencesDirectory  =   110
00100 Mac_DocumentsDirectory    =   111
00101 Mac_InternetSearchDirectory    =   112
00102 
00103 Win_SystemDirectory       =   201
00104 Win_WindowsDirectory      =   202
00105 
00106 Win_HomeDirectory         =   203
00107 Win_Desktop               =   204    
00108 Win_Programs              =   205    
00109 Win_Controls              =   206    
00110 Win_Printers              =   207    
00111 Win_Personal              =   208    
00112 Win_Favorites             =   209    
00113 Win_Startup               =   210    
00114 Win_Recent                =   211    
00115 Win_Sendto                =   212    
00116 Win_Bitbucket             =   213    
00117 Win_Startmenu             =   214    
00118 Win_Desktopdirectory      =   215    
00119 Win_Drives                =   216    
00120 Win_Network               =   217    
00121 Win_Nethood               =   218    
00122 Win_Fonts                 =   219    
00123 Win_Templates             =   220    
00124 Win_Common_Startmenu      =   221    
00125 Win_Common_Programs       =   222    
00126 Win_Common_Startup        =   223   
00127 Win_Common_Desktopdirectory = 224   
00128 Win_Appdata               =   225    
00129 Win_Printhood             =   226    
00130 
00131 Unix_LocalDirectory       =   301
00132 Unix_LibDirectory         =   302
00133 Unix_HomeDirectory        =   303
00134 
00135 BeOS_SettingsDirectory    =   401
00136 BeOS_HomeDirectory        =   402
00137 BeOS_DesktopDirectory     =   403
00138 BeOS_SystemDirectory      =   404
00139 
00140 OS2_SystemDirectory        =   501
00141 
00142 # Type/Variant related constants.
00143 TD_INT8              = 0
00144 TD_INT16             = 1
00145 TD_INT32             = 2
00146 TD_INT64             = 3
00147 TD_UINT8             = 4
00148 TD_UINT16            = 5
00149 TD_UINT32            = 6
00150 TD_UINT64            = 7
00151 TD_FLOAT             = 8
00152 TD_DOUBLE            = 9
00153 TD_BOOL              = 10
00154 TD_CHAR              = 11 
00155 TD_WCHAR             = 12
00156 TD_VOID              = 13  
00157 TD_PNSIID            = 14
00158 TD_DOMSTRING     = 15
00159 TD_PSTRING           = 16
00160 TD_PWSTRING          = 17
00161 TD_INTERFACE_TYPE    = 18
00162 TD_INTERFACE_IS_TYPE = 19
00163 TD_ARRAY             = 20
00164 TD_PSTRING_SIZE_IS   = 21
00165 TD_PWSTRING_SIZE_IS  = 22
00166 TD_UTF8STRING        = 23
00167 TD_CSTRING           = 24
00168 TD_ASTRING           = 25
00169 
00170 # From xpt_struct.h
00171 XPT_TDP_POINTER          = 0x80
00172 XPT_TDP_UNIQUE_POINTER   = 0x40
00173 XPT_TDP_REFERENCE        = 0x20
00174 XPT_TDP_FLAGMASK         = 0xe0
00175 XPT_TDP_TAGMASK          = (~XPT_TDP_FLAGMASK)
00176 def XPT_TDP_TAG(tdp): return (tdp & XPT_TDP_TAGMASK)
00177 
00178 def XPT_TDP_IS_POINTER(flags): return (flags & XPT_TDP_POINTER)
00179 def XPT_TDP_IS_UNIQUE_POINTER(flags): return (flags & XPT_TDP_UNIQUE_POINTER)
00180 def XPT_TDP_IS_REFERENCE(flags): return (flags & XPT_TDP_REFERENCE)
00181 
00182 XPT_ID_SCRIPTABLE           = 0x80
00183 XPT_ID_FLAGMASK             = 0x80
00184 XPT_ID_TAGMASK              = ~XPT_ID_FLAGMASK
00185 def XPT_ID_TAG(id): return id & XPT_ID_TAGMASK
00186 
00187 def XPT_ID_IS_SCRIPTABLE(flags): return flags & XPT_ID_SCRIPTABLE
00188 
00189 XPT_PD_IN       = 0x80
00190 XPT_PD_OUT      = 0x40
00191 XPT_PD_RETVAL   = 0x20
00192 XPT_PD_SHARED   = 0x10
00193 XPT_PD_DIPPER   = 0x08
00194 XPT_PD_FLAGMASK = 0xf0
00195 
00196 def XPT_PD_IS_IN(flags): return (flags & XPT_PD_IN)
00197 def XPT_PD_IS_OUT(flags): return (flags & XPT_PD_OUT)
00198 def XPT_PD_IS_RETVAL(flags): return (flags & XPT_PD_RETVAL)
00199 def XPT_PD_IS_SHARED(flags): return (flags & XPT_PD_SHARED)
00200 def XPT_PD_IS_DIPPER(flags): return (flags & XPT_PD_DIPPER)
00201 
00202 XPT_MD_GETTER = 0x80
00203 XPT_MD_SETTER = 0x40
00204 XPT_MD_NOTXPCOM = 0x20
00205 XPT_MD_CTOR = 0x10
00206 XPT_MD_HIDDEN = 0x08
00207 XPT_MD_FLAGMASK = 0xf8
00208 
00209 def XPT_MD_IS_GETTER(flags):     return (flags & XPT_MD_GETTER)
00210 def XPT_MD_IS_SETTER(flags):     return (flags & XPT_MD_SETTER)
00211 def XPT_MD_IS_NOTXPCOM(flags):   return (flags & XPT_MD_NOTXPCOM)
00212 def XPT_MD_IS_CTOR(flags):       return (flags & XPT_MD_CTOR)
00213 def XPT_MD_IS_HIDDEN(flags):     return (flags & XPT_MD_HIDDEN)
00214 
00215 # From xptinfo.h
00216 
00217 T_I8                = TD_INT8
00218 T_I16               = TD_INT16
00219 T_I32               = TD_INT32
00220 T_I64               = TD_INT64
00221 T_U8                = TD_UINT8
00222 T_U16               = TD_UINT16
00223 T_U32               = TD_UINT32
00224 T_U64               = TD_UINT64
00225 T_FLOAT             = TD_FLOAT
00226 T_DOUBLE            = TD_DOUBLE
00227 T_BOOL              = TD_BOOL
00228 T_CHAR              = TD_CHAR
00229 T_WCHAR             = TD_WCHAR
00230 T_VOID              = TD_VOID
00231 T_IID               = TD_PNSIID
00232 T_DOMSTRING        = TD_DOMSTRING
00233 T_CHAR_STR          = TD_PSTRING
00234 T_WCHAR_STR         = TD_PWSTRING
00235 T_INTERFACE         = TD_INTERFACE_TYPE
00236 T_INTERFACE_IS      = TD_INTERFACE_IS_TYPE
00237 T_ARRAY             = TD_ARRAY
00238 T_PSTRING_SIZE_IS   = TD_PSTRING_SIZE_IS
00239 T_PWSTRING_SIZE_IS  = TD_PWSTRING_SIZE_IS
00240 T_UTF8STRING        = TD_UTF8STRING
00241 T_CSTRING           = TD_CSTRING
00242 T_ASTRING           = TD_ASTRING
00243 
00244 # from nsIVariant
00245 VTYPE_INT8 = 0
00246 VTYPE_INT16 = 1
00247 VTYPE_INT32 = 2
00248 VTYPE_INT64 = 3
00249 VTYPE_UINT8 = 4
00250 VTYPE_UINT16 = 5
00251 VTYPE_UINT32 = 6
00252 VTYPE_UINT64 = 7
00253 VTYPE_FLOAT = 8
00254 VTYPE_DOUBLE = 9
00255 VTYPE_BOOL = 10
00256 VTYPE_CHAR = 11
00257 VTYPE_WCHAR = 12
00258 VTYPE_VOID = 13
00259 VTYPE_ID = 14
00260 VTYPE_DOMSTRING = 15
00261 VTYPE_CHAR_STR = 16
00262 VTYPE_WCHAR_STR = 17
00263 VTYPE_INTERFACE = 18
00264 VTYPE_INTERFACE_IS = 19
00265 VTYPE_ARRAY = 20
00266 VTYPE_STRING_SIZE_IS = 21
00267 VTYPE_WSTRING_SIZE_IS = 22
00268 VTYPE_UTF8STRING = 23
00269 VTYPE_CSTRING = 24
00270 VTYPE_ASTRING = 25
00271 VTYPE_EMPTY_ARRAY = 254
00272 VTYPE_EMPTY = 255