sl@0: /* sl@0: * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * CERTIFICATEAPPS.H sl@0: * CCertificateAppInfoManager class implementation sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __CERTIFICATEAPPS_H__ sl@0: #define __CERTIFICATEAPPS_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class MCTCertApps; sl@0: /** sl@0: * This class is used to access a persistent store which contains the available sl@0: * applications on a device. It provides an interface to add and retrieve sl@0: * applications. sl@0: * sl@0: * @publishedAll sl@0: * @released sl@0: */ sl@0: class CCertificateAppInfoManager : public CBase sl@0: { sl@0: public: sl@0: /** sl@0: * Creates a new instance of the app info manager and puts a pointer to it onto the cleanup stack. sl@0: * sl@0: * @return A new CCertificateAppInfoManager object. sl@0: */ sl@0: IMPORT_C static CCertificateAppInfoManager* NewLC(); sl@0: sl@0: /** sl@0: * Creates a new instance of the app info manager. sl@0: * sl@0: * @return A new CCertificateAppInfoManager object. sl@0: */ sl@0: IMPORT_C static CCertificateAppInfoManager* NewL(); sl@0: sl@0: /** sl@0: * Creates a new instance of the app info manager. sl@0: * sl@0: * @deprecated Clients should use the no-argument version. sl@0: */ sl@0: IMPORT_C static CCertificateAppInfoManager* NewLC(RFs& aFs, TBool aOpenedForWrite); sl@0: sl@0: /** sl@0: * Creates a new instance of the app info manager. sl@0: * sl@0: * @deprecated Clients should use the no-argument version. sl@0: */ sl@0: IMPORT_C static CCertificateAppInfoManager* NewL(RFs& aFs, TBool aOpenedForWrite); sl@0: sl@0: /** Virtual destructor. Frees all resources owned by the object, prior to its destruction. sl@0: */ sl@0: IMPORT_C virtual ~CCertificateAppInfoManager(); sl@0: sl@0: private: sl@0: CCertificateAppInfoManager(); sl@0: void ConstructL(); sl@0: sl@0: public: sl@0: /** sl@0: * Adds a new application. sl@0: * sl@0: * @param aClient The new application to add. sl@0: * @capability WriteDeviceData The caller requires the WriteDeviceData capability. sl@0: * @leave KErrPermissionDenied If the caller does not have the required capability. sl@0: */ sl@0: IMPORT_C void AddL(const TCertificateAppInfo& aClient); sl@0: sl@0: /** sl@0: * Removes an existing application. sl@0: * sl@0: * @param aUid The UID of the application to remove. sl@0: * @capability WriteDeviceData The caller requires the WriteDeviceData capability. sl@0: * @leave KErrPermissionDenied If the caller does not have the required capability. sl@0: * @leave KErrNotFound If there is no application matching the specified UID. sl@0: */ sl@0: IMPORT_C void RemoveL(const TUid& aUid); sl@0: sl@0: /** sl@0: * Gets an application by UID. sl@0: * sl@0: * @param aUid The UID of the application. sl@0: * @param aIndex On return, the index of the application in the store. sl@0: * @return Information about the application if it is present. sl@0: * @leave KErrNotFound If there is no application matching the specified UID. sl@0: */ sl@0: IMPORT_C const TCertificateAppInfo& ApplicationL(const TUid& aUid, TInt& aIndex) const; sl@0: sl@0: /** sl@0: * Gets a list of all applications in the store. sl@0: * sl@0: * @return An array containing all applications in the store. sl@0: */ sl@0: IMPORT_C const RArray& Applications() const; sl@0: sl@0: private: sl@0: MCTCertApps* iCertAppsIf; sl@0: /// A cache of the contents of the store sl@0: RArray iClients; sl@0: }; sl@0: sl@0: #endif