Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
31 const TInt KErrIrtranpPeerDoesNotHaveIrtranp = -5530;
33 _LIT8(KDefaultPMID, "\x08\x00\x74\x00\x00\x00\x00\x01"); //Casio's number
34 _LIT8(KNullPMID, "\x00\x00\x00\x00\x00\x00\x00\x00");
37 /** Encodes the size of a picture.
41 /** Quarter VGA, 320x240 pixels. */
43 /** Full VGA, 640x480 pixels. */
45 /** Super VGA, 800x600 pixels. */
47 /** XGA, 1024x768 pixels. */
49 /** Super XGA, 1280x960 pixels. */
51 /** Arbitrary size. There is no implied width and height. These values must be
52 explicitly supplied. */
56 NONSHARABLE_CLASS(TTranpConfig)
58 /** Encapsulates configuration parameters for a session.
64 IMPORT_C TTranpConfig();
65 IMPORT_C ~TTranpConfig();
67 IMPORT_C void SetPrimaryMachine(const TDesC8& aPMID);
68 IMPORT_C void SetSecondaryMachine(const TDesC8& aSMID);
70 IMPORT_C const TDesC8& PrimaryMachine();
71 IMPORT_C const TDesC8& SecondaryMachine();
77 // This data padding has been added to help prevent future binary compatibility breaks
78 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
84 // Encapsulation the UPF file format.
86 NONSHARABLE_CLASS(TTranpPicture)
88 /** Represents a picture in Unified Picture Format (UPF), a standard for image
89 data transmitted via infrared communication.
91 An object of this type is used when transmitting pictures using the IrTranP
94 A received picture can be saved as a JPEG type for viewing or it can be saved
99 friend class CTranpProtocol;
101 IMPORT_C void SetFilename(const TDesC8& aName);
102 IMPORT_C void SetLongFilename(const TDesC8& aName);
103 IMPORT_C void SetTime(const TDesC8& aTime);
105 IMPORT_C const TDesC8& Filename();
106 IMPORT_C const TDesC8& LongFilename();
107 IMPORT_C const TDesC8& Time();
108 IMPORT_C const TDesC8* Picture();
110 IMPORT_C void SetDesiredLatticeSize(TLatticeSize aSize, TInt iWidth = 0, TInt iHeight = 0); // Default is EVGA
111 IMPORT_C void GetLatticeSize(TLatticeSize& aSize, TInt& iWidth, TInt& iHeight);
113 IMPORT_C const TDesC8* GetThumbNail();
115 IMPORT_C TInt SaveAsJpeg(const TFileName& aFileName);
116 IMPORT_C TInt LoadFromJpeg(const TFileName& aFileName);
117 IMPORT_C TInt SaveAsUPF(const TFileName& aFileName);
118 IMPORT_C TInt LoadFromUPF(const TFileName& aFileName);
121 IMPORT_C TTranpPicture();
122 IMPORT_C ~TTranpPicture();
125 TBuf8<31> iFilename; // fomatted in DOS 8.3 format
126 TBuf8<256> iLongFilename; // in SJIS or ISO8859-1 [Latin-1]
127 TBuf8<14> iTime; // Time string in format YYYYMMDDHHMMSS
128 TPtrC8 iPicture; // Pointer to a buffer conatining the image data [JPEG format]
129 TDesC8* iUPFPicture; // Pointer to a buffer conatining the image data [UPF format]
130 TPtrC8 iThumbNail; // Pointer to a buffer conatining the thumbnail image data [JPEG format] Not implemented.
131 TLatticeSize iLatticeSize; // Size of picture
132 TInt iWidth; // QVGA:=320x240, VGA:=640x480, SVGA:=800x600, XGA:=1024x768, SXGA:=1280x960, FREE:=m x n
134 TInt iX; // Aspect Ratio iX:iY
138 // This data padding has been added to help prevent future binary compatibility breaks
139 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
145 // Callback interface for Asynchrnous requests
147 class MTranpNotification
148 /** A callback interface providing notification of events that occur during a picture
149 transmission session.
151 Users of a picture transmission session must derive from this class an provide
152 implementation for all of the pure virtual functions.
156 @see CTranpSession */
160 /** This function is called when a peer device connects successfully to the host
161 device following an attempt to receive a picture. */
162 virtual void Connected() = 0;
164 /** This function is called when a peer device disconnects or is disconnected from
166 virtual void Disconnected() =0;
168 /** This function is called when the reception of picture data is complete. */
169 virtual void GetComplete() = 0;
171 /** This function is called during the sending or receiving of picture data and
172 indicates the percentage of the data that has been transmitted.
174 @param aPercent The percentage of picture data transmitted. */
175 virtual void ProgressIndication(TInt aPercent) = 0;
177 /** This function is called when the sending of picture data is complete. */
178 virtual void PutComplete() = 0;
180 /** This function is called when an operation querying the processing ability of
181 a peer device completes. */
182 virtual void QueryComplete(/*return result from query [what]*/)= 0;
184 /** This function is called when the connection with the peer device drops during
185 picture data transmission.
187 @param aError An error code associated with the connection drop. Normally,
188 one of the system wide error codes. */
189 virtual void Error(TInt aError) =0;
192 Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is.
193 @param aInterface UID of the interface to return
194 @param aObject the container for another interface as specified by aInterface
196 IMPORT_C virtual void MTN_ExtensionInterfaceL(TUid aInterface, void*& aObject);
199 class CTranpProtocol;
201 NONSHARABLE_CLASS(CTranpSession) : public CBase
203 /** Encapsulates the behaviour for sending a picture to a peer device and for receiving
204 a picture from a peer device.
211 /** The type of information required from a peer device. */
213 /** Request still-information from the peer, e.g. resolution and size. */
215 /** Request information about the peer's battery status and free memory. */
217 /** Request how many commands can be executed in one SCEP session. */
222 // Constructs a TranP Session
223 IMPORT_C static CTranpSession* NewL(MTranpNotification& aNotifier);
226 void ConstructL(MTranpNotification& aNotifier);
229 // Methods for establishing a connection
230 IMPORT_C void Connect();
231 IMPORT_C void Disconnect();
232 IMPORT_C void Abort();
233 // Query capabilities of peer
234 IMPORT_C void Query(TTranP aWhat);
235 // Receive picture from peer
236 IMPORT_C void Get(TTranpPicture& aPicture);
237 // Send picture to peer
238 IMPORT_C void Put(const TTranpPicture& aPicture);
239 // Change configuration parameters
240 IMPORT_C void Config(const TTranpConfig& aConfig);
241 IMPORT_C TTranpConfig Config() const;
242 IMPORT_C ~CTranpSession();
248 CTranpProtocol* iTranpProtocol;
249 TTranpConfig iConfig;