Embedded camera view in a Symbian C++ app
Article Metadata
Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition
S60 2nd Edition
Article
Created: User:Technical writer 2
(04 Mar 2003)
Last edited: hamishwillee
(13 Sep 2012)
Overview
How can I add the camera view to an application, such as the Insert->New Image option in the Messaging Application?
Description
The following code lines demonstrate how to embed the camera application within an application. Besides the function that starts the camera application, MApaEmbeddedDocObserver::NotifyExit() must be implemented. It is called when the user has exited the camera application.
Solution
void MyApplication::NewImage()
{
const TUid KUidCamera = { 0x1000593F };
RApaLsSession apaLs;
TApaAppInfo appInfo;
CApaDocument* doc = NULL;
CEikProcess* process = CEikonEnv::Static()->Process();
User::LeaveIfError(apaLs.Connect());
CleanupClosePushL(apaLs);
User::LeaveIfError(apaLs.GetAppInfo(appInfo, KUidCamera));
doc = process->AddNewDocumentL(appInfo.iCaption, KUidCamera);
CleanupStack::PopAndDestroy(); // apaLs
TApaDocCleanupItem cleanup(process, doc);
CleanupStack::PushL(cleanup);
doc->NewDocumentL();
CleanupStack::Pop(); // cleanup
doc->EditL(this, ETrue);
}
void MyApplication::NotifyExit(TExitMode aMode)
{
// camera view has been closed
}


Md. Kayesh - Where is TApaDocCleanupItem ?
I don't find any documentation on it. Carbide says undefined identifier 'TApaDocCleanupItem'Md. Kayesh 19:20, 22 January 2012 (EET)
Hamishwillee - Try on Symlab
http://www.symlab.org/main/documentation/reference/s3/sdk/GUID-1F86DF8B-4A39-3BA8-A284-878ECCF56533.html
I'm not sure why this is not in the public library.hamishwillee 06:49, 23 January 2012 (EET)