|
1 /* |
|
2 * Copyright (c) 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 "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: Document class |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: da1mmcf#9 % |
|
19 |
|
20 |
|
21 #include <AiwGenericParam.h> |
|
22 #include <mpxviewutility.h> |
|
23 |
|
24 #include "mpxvideoplayerdocument.h" // header for this class |
|
25 #include "mpxvideoplayerappui.h" // application UI class |
|
26 #include "mpxvideoplayerlogger.h" |
|
27 #include "mpxvideo_debug.h" |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CMpxVideoPlayerDocument::CMpxVideoPlayerDocument |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 CMpxVideoPlayerDocument::CMpxVideoPlayerDocument( CEikApplication& aApp ) |
|
36 : CAiwGenericParamConsumer( aApp ) |
|
37 { |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CMpxVideoPlayerDocument::ConstructL |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 void CMpxVideoPlayerDocument::ConstructL() |
|
45 { |
|
46 // Get view utility. View utility must be created before AppUi. |
|
47 iViewUtility = MMPXViewUtility::UtilityL(); |
|
48 } |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CMpxVideoPlayerDocument::NewL |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 CMpxVideoPlayerDocument* CMpxVideoPlayerDocument::NewL( CEikApplication& aApp ) |
|
55 { |
|
56 MPX_ENTER_EXIT(_L("CMpxVideoPlayerDocument::NewL()")); |
|
57 |
|
58 CMpxVideoPlayerDocument* self = new ( ELeave ) CMpxVideoPlayerDocument( aApp ); |
|
59 CleanupStack::PushL( self ); |
|
60 self->ConstructL(); |
|
61 CleanupStack::Pop( self ); |
|
62 return self; |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CMpxVideoPlayerDocument::~CMpxVideoPlayerDocument |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 CMpxVideoPlayerDocument::~CMpxVideoPlayerDocument() |
|
70 { |
|
71 MPX_ENTER_EXIT(_L("CMpxVideoPlayerDocument::~CMpxVideoPlayerDocument()")); |
|
72 |
|
73 if ( iViewUtility ) |
|
74 { |
|
75 iViewUtility->Close(); |
|
76 } |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CMpxVideoPlayerDocument::CreateAppUiL |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 CEikAppUi* CMpxVideoPlayerDocument::CreateAppUiL() |
|
84 { |
|
85 return new ( ELeave ) CMpxVideoPlayerAppUi(); |
|
86 } |
|
87 |
|
88 // --------------------------------------------------------------------------- |
|
89 // From class CAknDocument. |
|
90 // Called by the framework to open a file. |
|
91 // --------------------------------------------------------------------------- |
|
92 // |
|
93 CFileStore* CMpxVideoPlayerDocument::OpenFileL( TBool aDoOpen, |
|
94 const TDesC& aFilename, |
|
95 RFs& aFs ) |
|
96 { |
|
97 MPX_ENTER_EXIT(_L("CMpxVideoPlayerDocument::OpenFileL()"), |
|
98 _L("aDoOpen = %d, aFileanme = %S"), aDoOpen, &aFilename ); |
|
99 |
|
100 if ( aDoOpen ) |
|
101 { |
|
102 // |
|
103 // Parse input parameters here |
|
104 // |
|
105 |
|
106 iAppUi->OpenFileL( aFilename ); |
|
107 } |
|
108 |
|
109 return CAknDocument::OpenFileL( aDoOpen, aFilename, aFs ); |
|
110 } |
|
111 |
|
112 |
|
113 // --------------------------------------------------------------------------- |
|
114 // From class CAknDocument. |
|
115 // Called by the framework to open a file. |
|
116 // --------------------------------------------------------------------------- |
|
117 // |
|
118 void CMpxVideoPlayerDocument::OpenFileL( CFileStore*& aFileStore, RFile& aFile ) |
|
119 { |
|
120 MPX_ENTER_EXIT(_L("CMpxVideoPlayerDocument::OpenFileL(RFile)")); |
|
121 |
|
122 const CAiwGenericParamList* params = GetInputParameters(); |
|
123 |
|
124 static_cast<CMpxVideoPlayerAppUi*>( iAppUi )->OpenFileL( aFile, params ); |
|
125 |
|
126 return CAknDocument::OpenFileL( aFileStore, aFile ); |
|
127 } |
|
128 |
|
129 // EOF |