installationservices/swcomponentregistry/inc_private/scrsubsession.h
branchRCL_3
changeset 25 7333d7932ef7
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
       
     1 /*
       
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * Declares SCR subsession implementation classes on the server side.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef SCRSUBSESSION_H
       
    27 #define SCRSUBSESSION_H
       
    28 
       
    29 #include "scrserver.h"
       
    30 #include "usifcommon.h"
       
    31 #include "appregentries.h"
       
    32 #include "appreginfo.h"
       
    33 #include "appregentries.h"
       
    34 
       
    35 namespace Usif
       
    36 	{
       
    37 	// forward declarations
       
    38 	class CStatement;
       
    39 	class CComponentEntry;
       
    40 	class CComponentFilter;
       
    41 	class CAppInfoFilter;
       
    42 	
       
    43 	class CScrSubsession : public CScsSubsession
       
    44 	/**
       
    45 		Base SCR Subsession. Owns handle to an existing database session.
       
    46 	 */
       
    47 		{
       
    48 	public:
       
    49 		virtual ~CScrSubsession();
       
    50 		
       
    51 	protected:
       
    52 		CScrSubsession(CScrSession &aSession);
       
    53 		void ConstructL();
       
    54 		
       
    55 	public:
       
    56 		CStatement *iStatement;
       
    57 		// Pointer to the server object. Owned by the session object. 
       
    58 		// Do NOT delete. Added to make the code cleaner and more consistent.
       
    59 		CScrServer *iServer; 
       
    60 		// Pointer to the session object. The owner session passes its own pointer. 
       
    61 		// Do NOT delete. Added to make the code cleaner and more consistent.
       
    62 		CScrSession *iSession;
       
    63 		};
       
    64 		
       
    65 	class CCompViewSubsessionContext : public CBase
       
    66 		{
       
    67 	friend class CScrRequestImpl;
       
    68 	friend class CComponentViewSubsession;
       
    69 	public:
       
    70 		~CCompViewSubsessionContext();
       
    71 	private:
       
    72 		TInt iLastSoftwareTypeId;
       
    73 		HBufC* iLastSoftwareTypeName;
       
    74 		RArray<TComponentId> iComponentFilterSuperset; ///< A helper array for the component filter. The filter conditions are split into two, and this variable is used for maintaing all components matching the first set of conditions.
       
    75 		TBool iFilterSupersetInUse; ///< Specifies whether the filter superset array should be used when iterating over the filter query.		
       
    76 		};
       
    77 	
       
    78 	class CComponentViewSubsession : public CScrSubsession
       
    79 	/**
       
    80 		This object is created for each component view subsession opened by the SCR client.
       
    81 		Handles component view creation by using a provided filter and returns the row(s) of the view.
       
    82 	 */
       
    83 		{
       
    84 	public:
       
    85 		static CComponentViewSubsession* NewL(CScrSession& aSession);
       
    86 		~CComponentViewSubsession();
       
    87 		// Implement CScsSession
       
    88 		TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
       
    89 			
       
    90 	private:
       
    91 		CComponentViewSubsession(CScrSession& aSession);
       
    92 		void ConstructL();
       
    93 			
       
    94 	private:
       
    95 		CComponentFilter* iFilter;
       
    96 		CComponentEntry *iComponentEntry;
       
    97 		RPointerArray<CComponentEntry> iComponentEntryList;
       
    98 		CCompViewSubsessionContext* iSubsessionContext;
       
    99 		};	
       
   100 	
       
   101 	class CFileListSubsession : public CScrSubsession
       
   102 	/**
       
   103 		This object is created for each file list subsession opened by the SCR client
       
   104 		to retrieve the list of files owned by a given component.
       
   105 	 */
       
   106 		{
       
   107 	public:
       
   108 		static CFileListSubsession* NewL(CScrSession& aSession);
       
   109 		~CFileListSubsession();
       
   110 		// Implement CScsSession
       
   111 		TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
       
   112 				
       
   113 	private:
       
   114 		CFileListSubsession(CScrSession& aSession);
       
   115 				
       
   116 	private:
       
   117 		HBufC *iFilePath;
       
   118 		RPointerArray<HBufC> iFileList;
       
   119 		};	
       
   120 	
       
   121     struct TAppUidWithLocaleInfo
       
   122          {
       
   123          TUid iAppUid;
       
   124          TLanguage iLocale;
       
   125          };
       
   126 
       
   127 	class CAppInfoViewSubsessionContext : public CBase
       
   128 	    {
       
   129 	    friend class CScrRequestImpl;
       
   130 	    friend class CAppInfoViewSubsession;
       
   131 	    public:
       
   132 	        ~CAppInfoViewSubsessionContext();
       
   133 	    private:
       
   134 	        TInt iAppInfoIndex;	     
       
   135 	        TLanguage iLocale;
       
   136 	        TInt iScreenMode;
       
   137 	        RArray<TAppUidWithLocaleInfo> iApps;
       
   138 	    };
       
   139 	
       
   140 	class CAppInfoViewSubsession : public CScrSubsession
       
   141 	    /**
       
   142 	        This object is created for each AppInfo view subsession opened by the SCR client.
       
   143 	        Handles component view creation by using a provided filter.
       
   144 	     */
       
   145 	        {
       
   146 	    public:
       
   147 	        static CAppInfoViewSubsession* NewL(CScrSession& aSession);
       
   148 	        ~CAppInfoViewSubsession();
       
   149 	        TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
       
   150 	            
       
   151 	    private:
       
   152 	        CAppInfoViewSubsession(CScrSession& aSession);
       
   153 	        void ConstructL();
       
   154 	            
       
   155 	    private:
       
   156 	        CAppInfoFilter* iAppInfoFilter;
       
   157 	        TAppRegInfo* iApaAppInfo;
       
   158 	        CAppInfoViewSubsessionContext* iSubsessionContext;
       
   159 	        };
       
   160 	
       
   161 	class CRegInfoForApplicationSubsessionContext : public CBase
       
   162 	            {
       
   163 	            friend class CScrRequestImpl;
       
   164 	            friend class CRegInfoForApplicationSubsession;
       
   165 	            public:
       
   166 	                ~CRegInfoForApplicationSubsessionContext();
       
   167 	            private:
       
   168 	                RPointerArray<Usif::CAppViewData> iViewInfoArray; //Application's view data information
       
   169 	                RArray<TUid> iServiceUidList;
       
   170 	                TLanguage iAppLanguageForCurrentLocale;
       
   171 	                RPointerArray<HBufC> iAppOwnedFiles;
       
   172 	            };
       
   173 	
       
   174 	class CRegInfoForApplicationSubsession : public CScrSubsession
       
   175 	    /**
       
   176 	        This object is created for an App Uid subsession opened by the SCR client
       
   177 	        to retrieve the App info.
       
   178 	     */
       
   179 	    {
       
   180 	    public:
       
   181 	        static CRegInfoForApplicationSubsession* NewL(CScrSession& aSession);
       
   182 	        ~CRegInfoForApplicationSubsession();
       
   183 	        // Implement CScsSession
       
   184 	        TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
       
   185 	                
       
   186 	    private:
       
   187 	        CRegInfoForApplicationSubsession(CScrSession& aSession);
       
   188 	        void ConstructL();       
       
   189 	    private:
       
   190 	        TUid iAppUid;
       
   191 	        CRegInfoForApplicationSubsessionContext *iSubsessionContext;
       
   192 	        };  
       
   193 
       
   194 	   class CApplicationRegInfoSubsessionContext : public CBase
       
   195 	       {
       
   196 	       friend class CScrRequestImpl;
       
   197 	       friend class CApplicationRegInfoSubsession;
       
   198 	   public:
       
   199 	       ~CApplicationRegInfoSubsessionContext();
       
   200 	       private:
       
   201 	       RPointerArray<Usif::CServiceInfo> iServiceInfoArray; //Application's service info details
       
   202 	       CAppServiceInfoFilter* iAppServiceInfoFilter;
       
   203 	       };
       
   204 
       
   205 	   class CApplicationRegInfoSubsession : public CScrSubsession
       
   206         /**
       
   207             This object is created for an App Uid subsession opened by the SCR client
       
   208             to retrieve the App info.
       
   209          */
       
   210 	    {
       
   211         public:
       
   212             static CApplicationRegInfoSubsession* NewL(CScrSession& aSession);
       
   213             ~CApplicationRegInfoSubsession();
       
   214 	        // Implement CScsSession
       
   215 	        TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
       
   216 	        
       
   217         private:
       
   218             void ConstructL();
       
   219 	    private:
       
   220 	        CApplicationRegInfoSubsession(CScrSession& aSession);	            
       
   221 	        CApplicationRegInfoSubsessionContext *iSubsessionContext;
       
   222 	    };  
       
   223 	
       
   224 	class CAppRegistrySubsessionContext : public CBase
       
   225 	        {
       
   226 	        friend class CScrRequestImpl;
       
   227 	        friend class CAppRegistrySubsession;
       
   228 	        public:
       
   229 	            ~CAppRegistrySubsessionContext();
       
   230 	        private:
       
   231 	            TLanguage iLanguage;
       
   232 	            TInt iAppRegIndex;       
       
   233 	            RArray<TUid> iAppUids;       //array of all the App Uid's      
       
   234 	        };
       
   235 	
       
   236     class CAppRegistrySubsession : public CScrSubsession
       
   237 	    /**
       
   238 	       This object is created for an Application registration subsession 
       
   239 	       opened by the SCR client to retrieve the Application registration info.
       
   240 	    */
       
   241 	    {
       
   242 	    public:
       
   243 	        static CAppRegistrySubsession* NewL(CScrSession& aSession);
       
   244 	        ~CAppRegistrySubsession();
       
   245 	        // Implement CScsSession
       
   246 	        TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
       
   247 	    private:
       
   248 	        CAppRegistrySubsession(CScrSession& aSession); 
       
   249 	        void ConstructL();	   
       
   250 	        CApplicationRegistrationData* iApplicationRegistrationInfo;
       
   251 	        CAppRegistrySubsessionContext* iSubsessionContext;
       
   252 	     };
       
   253     
       
   254 	}// End of namespace Usif
       
   255 
       
   256 
       
   257 #endif /* SCRSUBSESSION_H */