⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guiclock8_document.cpp__.htm

📁 symbian clock 源代码..........
💻 HTM
字号:
<html><head><title>Exercise_GUIClock.rar GUIClock8_document.cpp</title>
<LINK href="/inc/read_style.css" type=text/css rel=stylesheet></head>
<body>
<p><a href=http://www.pudn.com>www.pudn.com</a> &gt; <a href="http://www.pudn.com/downloads91/sourcecode/comm/symbian/detail348522.html">Exercise_GUIClock.rar</a> &gt GUIClock8_document.cpp</p><!-- saved from http://www.pudn.com -->
<script src="/inc/gg_read1.js"></script><BR>
<pre name="code" class="cpp">
// GUIClock_CGUIClockDocument.cpp 
// ------------------------------- 
// 
// Copyright (c) 2000 Symbian Ltd.  All rights reserved. 
// 
 
//////////////////////////////////////////////////////////////////////// 
// 
// Source file for the implementation of the  
// document class - CGUIClockDocument 
// 
//////////////////////////////////////////////////////////////////////// 
 
#include "GUIClock8.h" 
#include "alarm.h" 
 
//             The constructor of the document class just passes the 
//             supplied reference to the constructor initialisation list. 
//             The document has no real work to do in this application. 
CGUIClockDocument::CGUIClockDocument(CAknApplication& aApp) 
: CAknDocument(aApp) 
{ 
} 
 
 
//             This is called by the UI framework as soon as the  
//             document has been created. It creates an instance 
//             of the ApplicationUI. The Application UI class is 
//             an instance of a CEikAppUi derived class. 
// 
CEikAppUi* CGUIClockDocument::CreateAppUiL() 
{ 
	return (static_cast <CEikAppUi*> (new (ELeave) CGUIClockUi));  
//	return new(ELeave) CGUIClockUi; 
} 
 
void CGUIClockDocument::ConstructL() 
{ 
	iClock = CSimpleClock::NewL(); 
	iAlarm = CAlarm::NewL(); 
	iClock->AddObserver(iAlarm); 
} 
 
CGUIClockDocument* CGUIClockDocument::NewL(CAknApplication& aApp) 
{ 
	CGUIClockDocument *self = new (ELeave) CGUIClockDocument(aApp); 
	CleanupStack::PushL(self); 
	self->ConstructL(); 
	CleanupStack::Pop(self); 
	return self; 
	 
} 
 
 
CGUIClockDocument::~CGUIClockDocument() 
{ 
	iClock->Stop(); 
	delete iClock; 
	delete iAlarm; 
} 
 
 
 
CFileStore* CGUIClockDocument::OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs) 
{ 
	return 	CEikDocument::OpenFileL( aDoOpen, aFilename, aFs); 
} 
 
void CGUIClockDocument::StoreL(CStreamStore& aStore, CStreamDictionary& aStreamDic) const 
{ 
	RStoreWriteStream stream; 
	 
	TStreamId id = stream.CreateLC(aStore); 
	 
	iSetting.ExternalizeL(stream); 
	stream.CommitL(); 
 
	aStreamDic.AssignL(Application()->AppDllUid(), id); 
	CleanupStack::PopAndDestroy(); // stream 
	 
} 
 
 
void CGUIClockDocument::RestoreL( const CStreamStore& aStore, const CStreamDictionary& aStreamDic) 
{ 
    TStreamId id = aStreamDic.At(Application()->AppDllUid()); 
	RStoreReadStream stream; 
	stream.OpenLC(aStore, id ); 
	 
	iSetting.InternalizeL(stream); 
 
	if(iSetting.Time().Int64()!=0) 
		//iClock->SetCurTime(iSetting.Time()); 
		iAlarm->SetAlarmTime(iSetting.Time()); 
	 
	CleanupStack::PopAndDestroy();  // stream 
 
} 
 
 
void CGUIClockDocument::SetAlarmTime(TTime aTime) 
{ 
	iAlarm->SetAlarmTime(aTime); 
}</pre>
<script src="/inc/gg_read2.js"></script><BR>
<script src="http://s117.cnzz.com/stat.php?id=1236358&web_id=1236358&show=pic" language="JavaScript" charset="gb2312"></script>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -