|
1 /* |
|
2 * Copyright (c) 2002-2005 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: |
|
15 * This class extends standard CAknDocument behaviour by adding |
|
16 * means of simple data exchange between two applications sharing |
|
17 * document of this class type. The application that is being |
|
18 * called has to be running as an embedded process |
|
19 * of the calling application. |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 #ifndef __CMEDIASHAREDDOCUMENT_H__ |
|
25 #define __CMEDIASHAREDDOCUMENT_H__ |
|
26 |
|
27 // INCLUDES |
|
28 #include <akndoc.h> |
|
29 #include <eikapp.h> |
|
30 |
|
31 // CLASS DEFINITION |
|
32 /** |
|
33 * This class extends standard CAknDocument behaviour by adding |
|
34 * means of simple data exchange between two applications sharing |
|
35 * document of this class type. The application that is being |
|
36 * called has to be running as an embedded process |
|
37 * of the calling application. |
|
38 */ |
|
39 class CMediaSharedDocument : public CAknDocument |
|
40 { |
|
41 public: // Enumerations |
|
42 |
|
43 enum TMediaSharedMode |
|
44 { |
|
45 EModeNormal = 0, |
|
46 EModeNew, |
|
47 EModeNewMany |
|
48 }; |
|
49 |
|
50 protected: // Constructors |
|
51 |
|
52 /** |
|
53 * Constructor. |
|
54 * @param aApp Reference to the application object. |
|
55 */ |
|
56 CMediaSharedDocument( CEikApplication& aApp ) : CAknDocument( aApp ), |
|
57 iAppStartMode( EModeNormal ) { } |
|
58 |
|
59 public: // New methods |
|
60 |
|
61 /** |
|
62 * Set application's embedding mode. |
|
63 * @param aMode The new mode. |
|
64 */ |
|
65 inline void SetAppModeArg( const TInt aMode = EModeNormal ); |
|
66 |
|
67 /** |
|
68 * Return application's embedding mode. |
|
69 * @return The current mode. |
|
70 */ |
|
71 inline TInt GetAppModeArg(); |
|
72 |
|
73 /** |
|
74 * Set application's data file name or path. |
|
75 * Caller may set target path where producer should place |
|
76 * generated file(s). If empty producer uses its default |
|
77 * location. |
|
78 * @param aFileName The new file name |
|
79 */ |
|
80 inline void SetFileName( const TDesC& aFileName ); |
|
81 |
|
82 /** |
|
83 * Get application's data file name. |
|
84 * @param aFileName The current file name |
|
85 */ |
|
86 inline void GetFileName( TDes& aFileName ); |
|
87 |
|
88 /** |
|
89 * Set application specific data. |
|
90 * @param aMode The new data value. |
|
91 */ |
|
92 inline void SetAppData( const TInt aData ); |
|
93 |
|
94 /** |
|
95 * Return application specific data. |
|
96 * @return The current data value. |
|
97 */ |
|
98 inline TInt GetAppData(); |
|
99 |
|
100 |
|
101 protected: // data |
|
102 |
|
103 /** |
|
104 * Embedding launch mode argument. |
|
105 */ |
|
106 TInt iAppStartMode; |
|
107 |
|
108 /** |
|
109 * Full path and name of media content passed from/to the parent process. |
|
110 */ |
|
111 TFileName iFileName; |
|
112 |
|
113 /** |
|
114 * Application specific data. |
|
115 */ |
|
116 TInt iAppData; |
|
117 |
|
118 }; |
|
119 |
|
120 inline void CMediaSharedDocument::SetAppModeArg( const TInt aMode ) |
|
121 { |
|
122 iAppStartMode = aMode; |
|
123 } |
|
124 |
|
125 inline TInt CMediaSharedDocument::GetAppModeArg() |
|
126 { |
|
127 return iAppStartMode; |
|
128 } |
|
129 |
|
130 inline void CMediaSharedDocument::SetFileName( const TDesC& aFileName ) |
|
131 { |
|
132 iFileName.Copy( aFileName ); |
|
133 } |
|
134 |
|
135 inline void CMediaSharedDocument::GetFileName( TDes& aFileName ) |
|
136 { |
|
137 aFileName.Copy( iFileName ); |
|
138 } |
|
139 |
|
140 inline void CMediaSharedDocument::SetAppData( const TInt aData ) |
|
141 { |
|
142 iAppData = aData; |
|
143 } |
|
144 |
|
145 inline TInt CMediaSharedDocument::GetAppData() |
|
146 { |
|
147 return iAppData; |
|
148 } |
|
149 |
|
150 #endif // __CMEDIASHAREDDOCUMENT_H__ |
|
151 |
|
152 // End of File |