installationservices/swcomponentregistry/inc_private/scrsubsession.h
changeset 24 84a16765cd86
child 25 98b66e4fb0be
equal deleted inserted replaced
6:aba6b8104af3 24:84a16765cd86
       
     1 /*
       
     2 * Copyright (c) 2008-2009 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 
       
    32 namespace Usif
       
    33 	{
       
    34 	// forward declarations
       
    35 	class CStatement;
       
    36 	class CComponentEntry;
       
    37 	class CComponentFilter;
       
    38 	
       
    39 	class CScrSubsession : public CScsSubsession
       
    40 	/**
       
    41 		Base SCR Subsession. Owns handle to an existing database session.
       
    42 	 */
       
    43 		{
       
    44 	public:
       
    45 		virtual ~CScrSubsession();
       
    46 		
       
    47 	protected:
       
    48 		CScrSubsession(CScrSession &aSession);
       
    49 		void ConstructL();
       
    50 		
       
    51 	public:
       
    52 		CStatement *iStatement;
       
    53 		// Pointer to the server object. Owned by the session object. 
       
    54 		// Do NOT delete. Added to make the code cleaner and more consistent.
       
    55 		CScrServer *iServer; 
       
    56 		// Pointer to the session object. The owner session passes its own pointer. 
       
    57 		// Do NOT delete. Added to make the code cleaner and more consistent.
       
    58 		CScrSession *iSession;
       
    59 		};
       
    60 		
       
    61 	class CCompViewSubsessionContext : public CBase
       
    62 		{
       
    63 	friend class CScrRequestImpl;
       
    64 	friend class CComponentViewSubsession;
       
    65 	public:
       
    66 		~CCompViewSubsessionContext();
       
    67 	private:
       
    68 		TInt iLastSoftwareTypeId;
       
    69 		HBufC* iLastSoftwareTypeName;
       
    70 		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.
       
    71 		TBool iFilterSupersetInUse; ///< Specifies whether the filter superset array should be used when iterating over the filter query.		
       
    72 		};
       
    73 	
       
    74 	class CComponentViewSubsession : public CScrSubsession
       
    75 	/**
       
    76 		This object is created for each component view subsession opened by the SCR client.
       
    77 		Handles component view creation by using a provided filter and returns the row(s) of the view.
       
    78 	 */
       
    79 		{
       
    80 	public:
       
    81 		static CComponentViewSubsession* NewL(CScrSession& aSession);
       
    82 		~CComponentViewSubsession();
       
    83 		// Implement CScsSession
       
    84 		TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
       
    85 			
       
    86 	private:
       
    87 		CComponentViewSubsession(CScrSession& aSession);
       
    88 		void ConstructL();
       
    89 			
       
    90 	private:
       
    91 		CComponentFilter* iFilter;
       
    92 		CComponentEntry *iComponentEntry;
       
    93 		RPointerArray<CComponentEntry> iComponentEntryList;
       
    94 		CCompViewSubsessionContext* iSubsessionContext;
       
    95 		};	
       
    96 	
       
    97 	class CFileListSubsession : public CScrSubsession
       
    98 	/**
       
    99 		This object is created for each file list subsession opened by the SCR client
       
   100 		to retrieve the list of files owned by a given component.
       
   101 	 */
       
   102 		{
       
   103 	public:
       
   104 		static CFileListSubsession* NewL(CScrSession& aSession);
       
   105 		~CFileListSubsession();
       
   106 		// Implement CScsSession
       
   107 		TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
       
   108 				
       
   109 	private:
       
   110 		CFileListSubsession(CScrSession& aSession);
       
   111 				
       
   112 	private:
       
   113 		HBufC *iFilePath;
       
   114 		RPointerArray<HBufC> iFileList;
       
   115 		};	
       
   116 	
       
   117 	}// End of namespace Usif
       
   118 
       
   119 
       
   120 #endif /* SCRSUBSESSION_H */