Back to index

lightning-sunbird  0.9+nobinonly
nsInstallVersion.h
Go to the documentation of this file.
00001 #ifndef __NS_INSTALLVERSION_H__
00002 #define __NS_INSTALLVERSION_H__
00003 
00004 #include "nscore.h"
00005 #include "nsString.h"
00006 #include "nsIFactory.h"
00007 #include "nsISupports.h"
00008 #include "nsIScriptObjectOwner.h"
00009 
00010 #include "nsIDOMInstallVersion.h"
00011 #include "nsSoftwareUpdate.h"
00012 
00013 #include "prtypes.h"
00014 
00015 class nsInstallVersion: public nsIScriptObjectOwner, public nsIDOMInstallVersion
00016 {
00017     public:
00018         static const nsIID& IID() { static nsIID iid = NS_SoftwareUpdateInstallVersion_CID; return iid; }
00019 
00020         nsInstallVersion();
00021         virtual ~nsInstallVersion();
00022 
00023         NS_DECL_ISUPPORTS
00024 
00025         NS_IMETHOD    GetScriptObject(nsIScriptContext *aContext, void** aScriptObject);
00026         NS_IMETHOD    SetScriptObject(void* aScriptObject);
00027 
00028         NS_IMETHOD    Init(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild);
00029         NS_IMETHOD    Init(const nsString& aVersionString);
00030 
00031         NS_IMETHOD    GetMajor(PRInt32* aMajor);
00032         NS_IMETHOD    SetMajor(PRInt32 aMajor);
00033 
00034         NS_IMETHOD    GetMinor(PRInt32* aMinor);
00035         NS_IMETHOD    SetMinor(PRInt32 aMinor);
00036 
00037         NS_IMETHOD    GetRelease(PRInt32* aRelease);
00038         NS_IMETHOD    SetRelease(PRInt32 aRelease);
00039 
00040         NS_IMETHOD    GetBuild(PRInt32* aBuild);
00041         NS_IMETHOD    SetBuild(PRInt32 aBuild);
00042 
00043         NS_IMETHOD    ToString(nsString& aReturn);
00044         NS_IMETHOD    CompareTo(nsIDOMInstallVersion* aVersion, PRInt32* aReturn);
00045         NS_IMETHOD    CompareTo(const nsString& aString, PRInt32* aReturn);
00046         NS_IMETHOD    CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn);
00047 
00048     private:
00049         void *mScriptObject;
00050         PRInt32 mMajor;
00051         PRInt32 mMinor;
00052         PRInt32 mRelease;
00053         PRInt32 mBuild;
00054 };
00055 
00056 
00057 #define NS_INSTALLVERSIONCOMPONENT_CONTRACTID  "@mozilla.org/xpinstall/installversion;1"
00058 #endif