diff -r aba6b8104af3 -r 84a16765cd86 installationservices/swcomponentregistry/inc/screntries_internal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/installationservices/swcomponentregistry/inc/screntries_internal.h Fri Mar 19 09:33:35 2010 +0200 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Declares entry classes for Software Components Registry interface. +* +*/ + + +/** + @file + @internalComponent + @released +*/ + +#ifndef SCRENTRIES_INTERNAL_H +#define SCRENTRIES_INTERNAL_H + +#include +#include +#include +#include +#include + +//class Usif::CLocalizableCommonData; +//class Usif::CScrLogEntry; + +namespace Usif + { + class CLocalizableCommonData; + NONSHARABLE_CLASS(CLocalizedSoftwareTypeName) : public CLocalizableCommonData + /** + This class contains localized software type names. + Software type names are localizable names and transferred to the SCR + with the objects of this class. + + @internalTechnology + */ + { + public: + /** + Creates a localized software type name object. + @param aName The name of the software type. + @param aLocale The language code of the object's locale. + @return A pointer to the newly allocated localized software type name object, if creation is successful. + */ + IMPORT_C static CLocalizedSoftwareTypeName* NewL(const TDesC& aName, TLanguage aLocale); + + /** + Creates a localized software type name object. + @param aName The name of the software type. + @param aLocale The language code of the object's locale. + @return A pointer to the newly allocated localized software type name object, if creation is successful. + The pointer is also put onto the cleanup stack. + */ + IMPORT_C static CLocalizedSoftwareTypeName* NewLC(const TDesC& aName, TLanguage aLocale); + + /** + Creates a localized software type name object from a stream. + @param aStream The stream to read the localized software type name object from. + @return A pointer to the newly allocated localized software type name object, if creation is successful. + @internalComponent + */ + IMPORT_C static CLocalizedSoftwareTypeName* NewL(RReadStream& aStream); + + ~CLocalizedSoftwareTypeName(); + + /** + Externalises a localized software type name object to a write stream. + @param aStream The stream to which the object is externalised. + @internalComponent + */ + IMPORT_C void ExternalizeL(RWriteStream& aStream) const; + + /** @return The localized software type name. */ + IMPORT_C const TDesC& NameL() const; + + private: + CLocalizedSoftwareTypeName(); + CLocalizedSoftwareTypeName(TLanguage aLocale); + void ConstructL(const TDesC& aName); + void InternalizeL(RReadStream& aStream); + + private: + HBufC* iName; ///< The localized software type name. + }; + + NONSHARABLE_CLASS (CScrLogEntry) : public CBase + /** + Class that represents a software component log record generated by the SCR. + */ + { + friend class CScrRequestImpl; + public: + /** + Creates a log entry object. + @param aComponentName The name of the component. + @param aUniqueSwTypeName The non-localized, unique software type name, such as @see Usif::KSoftwareTypeNative and @see Usif::KSoftwareTypeJava. + @param aGlobalId The global Id of the component. + @param aVersion The version of the component. + @param aCompOpType The type of the component operation. @see Usif::TScrComponentOperationType + @return A pointer to the newly allocated log entry object, if creation is successful. + @internalComponent + */ + IMPORT_C static CScrLogEntry* NewL(const TDesC& aComponentName, const TDesC& aUniqueSwTypeName, const TDesC& aGlobalId, const TDesC& aVersion, const TScrComponentOperationType aCompOpType); + + /** + Creates a log entry object. + @param aComponentName The name of the component. + @param aUniqueSwTypeName The non-localized, unique software type name, such as @see Usif::KSoftwareTypeNative and @see Usif::KSoftwareTypeJava. + @param aGlobalId The global Id of the component. + @param aVersion The version of the component. + @param aCompOpType The type of the component operation. @see Usif::TScrComponentOperationType + @return A pointer to the newly allocated log entry object, if creation is successful. + The pointer is also put onto the cleanup stack. + @internalComponent + */ + IMPORT_C static CScrLogEntry* NewLC(const TDesC& aComponentName, const TDesC& aUniqueSwTypeName, const TDesC& aGlobalId, const TDesC& aVersion, const TScrComponentOperationType aCompOpType); + + /** + Creates a log entry object from a stream. + @param aStream The stream to read the log entry object from. + @return A pointer to the newly allocated log entry object, if creation is successful. + The pointer is also put onto the cleanup stack. + @internalComponent + */ + IMPORT_C static CScrLogEntry* NewLC(RReadStream& aStream); + + ~CScrLogEntry(); + + /** + Write the object to a stream + + @param aStream The stream to write to + @internalComponent + */ + IMPORT_C void ExternalizeL(RWriteStream& aStream) const; + + /** + Read the object from a stream + + @param aStream The stream to read from. + @internalComponent + */ + IMPORT_C void InternalizeL(RReadStream& aStream) ; + + /** + @return The name of the component for which the log was generated. + */ + IMPORT_C const TDesC& ComponentName() const; + + /** + @return The non-localized, unique software type name, such as @see Usif::KSoftwareTypeNative and @see Usif::KSoftwareTypeJava. + */ + IMPORT_C const TDesC& SoftwareTypeName() const; + + /** + The UID. + @return The global ID of the component. + */ + IMPORT_C const TDesC& GlobalId() const; + + /** + @return The version of the component. + */ + IMPORT_C const TDesC& ComponentVersion() const; + + /** + @return The time when the operation occured. + */ + IMPORT_C const TTime OperationTime() const; + + /** + @return The type of the component operation for the log record. + */ + IMPORT_C TScrComponentOperationType OperationType() const; + + /** + @return The component id of the log record. + @internalComponent + */ + IMPORT_C TComponentId ComponentId() const; + + private: + CScrLogEntry(); + void ConstructL(const TDesC& aComponentName, const TDesC& aUniqueSwTypeName, const TDesC& aGlobalId, const TDesC& aVersion, const TScrComponentOperationType aCompOpType); + + private: + HBufC* iComponentName ; + HBufC* iSwTypeName; + HBufC* iVersion; + TScrComponentOperationType iOpType ; + TTime iRecordTime ; + HBufC* iGlobalId; + TComponentId iComponentId; + }; + + } // End of namespace Usif + +#endif // SCRENTRIES_H