creator/inc/creator_file.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 19 Aug 2010 09:55:38 +0300
branchRCL_3
changeset 20 48060abbbeaf
parent 0 d6fe6244b863
permissions -rw-r--r--
Revision: 201029 Kit: 201033

/*
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "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:  
*
*/




#ifndef __CREATORFiles_H__
#define __CREATORFiles_H__

#include "creator_model.h"
#include "creator_modulebase.h"

#include <caf/caf.h>
using namespace ContentAccess;

#include <e32base.h>
#include <bautils.h>
#include <pathinfo.h>
#include <apgcli.h> // RApaLsSession

class CCreatorEngine;
class CFilesParameters;
class CDRMPermission;
class CDRMConstraint;

class CCreatorFiles : public CBase, public MCreatorModuleBase
    {
public: 
    static CCreatorFiles* NewL(CCreatorEngine* aEngine);
    static CCreatorFiles* NewLC(CCreatorEngine* aEngine);
    ~CCreatorFiles();

private:
    CCreatorFiles();
    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase

public:
    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
    TInt CreateFileEntryL(CFilesParameters *aParameters, TInt aCommand);    
    void DeleteAllL();
    void DeleteAllCreatedByCreatorL();

private:
    
    void EncryptFileL( const TDesC& aFileName, const TDesC& aOutFileName, CFilesParameters *aParameters );
    void SetPermissionsL( CMetaDataArray* aMetaData, const TDesC& aOutFileName, CFilesParameters *aParameters );
    void SetMimeTypeL( const TDesC& aFileName, TDes8& aMime, CFilesParameters *aParameters );
    TBool AskDRMDataFromUserL();
    TBool AskDRMCDDataFromUserL();
    void StorePathsForDeleteL( CDesCArray& aPaths );
    void GenerateFileNameL( TFileName& aRootName );
    
private:
    CFilesParameters* iParameters;
    CFilesParameters* iUserParameters;
    HBufC* iDirectoryQueriedFromUser;
    RFs& iFs;
    RApaLsSession iApaLs;
    CDesCArray* iFilePaths;
    TInt iFileId;

public:
    };


class CFilesParameters : public CCreatorModuleBaseParameters
    {
public: 
    HBufC*          iFullFilePath;
    TInt            iFileCommand;
    CDRMPermission* iPermission;
    TBool           iEncrypt;
    
public:
    CFilesParameters();
    CFilesParameters( CFilesParameters& aCopy );
    ~CFilesParameters();
    };



#endif // __CREATORFiles_H__