rtsecuritymanager/rtsecuritymanagerserver/inc/rtsecmgrprotectiondomain.h
changeset 57 61b27eec6533
parent 45 7aa6007702af
equal deleted inserted replaced
45:7aa6007702af 57:61b27eec6533
     1 /*
       
     2 * Copyright (c) 2007-2008 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:       Definition of security protection domain
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef C_RTSECMGRPROTECTIONDOMAIN_H
       
    24 #define C_RTSECMGRPROTECTIONDOMAIN_H
       
    25 
       
    26 #include <e32capability.h>
       
    27 #include <rtsecmgrutility.h>
       
    28 #include <rtsecmgrscript.h>
       
    29 #include "rtsecmgrdef.h"
       
    30 
       
    31 /* 
       
    32  * Models a protection domain. A protection domain is part of a security policy.
       
    33  * A security policy could have more than one protection domain.
       
    34  *
       
    35  * Every protection domain has a name, list of unconditionally allowed permissions
       
    36  * and set of user grantable permissions.
       
    37  *
       
    38  * @see CPermissionSet
       
    39  * 
       
    40  * @exe rtsecmgrserver.exe
       
    41  * 
       
    42  */
       
    43 NONSHARABLE_CLASS(CProtectionDomain) : public CBase
       
    44 	{
       
    45 public:
       
    46 
       
    47 	/**
       
    48 	 * Two-phased constructor
       
    49 	 * 
       
    50 	 * Constructs a CProtectionDomain instance
       
    51 	 * 
       
    52 	 * @return CProtectionDomain* pointer to an instance of CProtectionDomain
       
    53 	 */
       
    54 	static CProtectionDomain* NewL();
       
    55 
       
    56 	/**
       
    57 	 * Two-phased constructor
       
    58 	 * 
       
    59 	 * Constructs a CProtectionDomain instance and leaves the created instance
       
    60 	 * on the cleanupstack
       
    61 	 * 
       
    62 	 * @return CProtectionDomain* pointer to an instance of CProtectionDomain
       
    63 	 */
       
    64 	static CProtectionDomain* NewLC();
       
    65 
       
    66 	/**
       
    67 	 * Two-phased constructor
       
    68 	 * 
       
    69 	 * Constructs a CProtectionDomain instance from the input
       
    70 	 * read source
       
    71 	 * 
       
    72 	 * @param aSource RStoreReadStream& Input readable source
       
    73 	 * 
       
    74 	 * @return CProtectionDomain* pointer to an instance of CProtectionDomain
       
    75 	 */
       
    76 	static CProtectionDomain* NewL(RStoreReadStream& aSource);
       
    77 
       
    78 	/**
       
    79 	 * Two-phased constructor
       
    80 	 * 
       
    81 	 * Constructs a CProtectionDomain instance from the input
       
    82 	 * read source and leaves the created instance on the cleanup
       
    83 	 * stack
       
    84 	 *  
       
    85 	 * @param aSource RStoreReadStream& Input readable source
       
    86 	 * 
       
    87 	 * @return CProtectionDomain* pointer to an instance of CProtectionDomain
       
    88 	 */
       
    89 	static CProtectionDomain* NewLC(RStoreReadStream& aSource);
       
    90 	
       
    91 	/**
       
    92 	 * Destructor
       
    93 	 * 
       
    94 	 * Performs clean-up of domain name descriptor and
       
    95 	 * permission set
       
    96 	 * 
       
    97 	 */
       
    98 	~CProtectionDomain();
       
    99 
       
   100 	/**
       
   101 	 * Gets underlying permission set instance
       
   102 	 * 
       
   103 	 * @return const CPermissionSet& permission set instance
       
   104 	 * 
       
   105 	 */
       
   106 	inline const CPermissionSet& PermSet() const;
       
   107 
       
   108 	/**
       
   109 	 * Gets domain name
       
   110 	 * 
       
   111 	 * @return const TDesC& domain name
       
   112 	 * 
       
   113 	 */
       
   114 	inline const TDesC& DomainName() const;
       
   115 
       
   116 	/**
       
   117 	 * Sets domain name
       
   118 	 * 
       
   119 	 * @param aDomainName const TDesC& input domain name string
       
   120 	 */
       
   121 	inline void SetDomainName(const TDesC& aDomainName);
       
   122 
       
   123 	/**
       
   124 	 * Sets permission set
       
   125 	 * 
       
   126 	 * @param aPermissionSet CPermissionSet* input permission set
       
   127 	 */
       
   128 	inline void SetCapInfo(CPermissionSet* aPermissionSet);
       
   129 
       
   130 	/**
       
   131 	 * Externalises CProtectionDomain data to writable output stream
       
   132 	 * 
       
   133 	 * @param aSink RStoreWriteStream& writable output stream
       
   134 	 */
       
   135 	void ExternalizeL(RStoreWriteStream& aSink) const;
       
   136 
       
   137 	/**
       
   138 	 * Internalises CProtectionDomain data from readble input stream
       
   139 	 * 
       
   140 	 * @param aSource RStoreReadStream& readble input stream
       
   141 	 */
       
   142 	void InternalizeL(RStoreReadStream& aSource);
       
   143 
       
   144 private:
       
   145 	/**
       
   146 	 * Default private constructor
       
   147 	 * 
       
   148 	 */
       
   149 	inline CProtectionDomain();
       
   150 
       
   151 	/**
       
   152 	 * Two phased constructor
       
   153 	 * 
       
   154 	 */
       
   155 	inline void ConstructL();
       
   156 
       
   157 private:
       
   158 	/*
       
   159 	 * Domain name
       
   160 	 * 
       
   161 	 * Own.
       
   162 	 */
       
   163 	HBufC* iDomain;
       
   164 	
       
   165 	/*
       
   166 	 * Permissionset instance
       
   167 	 * 
       
   168 	 * Own.
       
   169 	 */
       
   170 	CPermissionSet* iPermSet;
       
   171 	};
       
   172 
       
   173 #include "rtsecmgrprotectiondomain.inl"
       
   174 	
       
   175 #endif //C_RTSECMGRPROTECTIONDOMAIN_H
       
   176