// ---------------------------------------------------------
// CPosLmLocalDatabaseManager::SynchronizeRegistryL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CPosLmLocalDatabaseManager::SynchronizeRegistryL()
    {
    RPointerArray<HPosLmDatabaseInfo> databaseInfoArray(KPosDbListGranularity);
    CleanupStack::PushL(TCleanupItem(CleanupRPointerArray, &databaseInfoArray));

    // list URIs
    CDesCArray* dbUriArray = ListDatabasesLC();

    // list registered databases
    Session().ListDatabasesL(databaseInfoArray, KFileProtocol);

    // unregister database which cannot be found on disk
    for (TInt i = databaseInfoArray.Count() - 1; i >= 0; i--)
        {
        TInt index;
        TPtrC registeredUri = databaseInfoArray[i]->DatabaseUri();
        if (dbUriArray->Find(registeredUri, index) != 0)
            {
            // unregister database
            User::LeaveIfError(Session().UnregisterDatabase(registeredUri,
                DatabaseDrive(registeredUri)));
            }
        }
    CleanupStack::PopAndDestroy(2, &databaseInfoArray);  // dbUriArray
    }
// -----------------------------------------------------------------------------
// CMceComAudioStream::UpdateL
// -----------------------------------------------------------------------------
//
void CMceComAudioStream::UpdateL( CMceComMediaStream& aStream )
    {  
    CMceComMediaStream::UpdateL( aStream );

    CMceComAudioStream* stream = static_cast<CMceComAudioStream*>( &aStream );
    
    RPointerArray<CMceComAudioCodec> updated;
    
    MceCleanupResetAndDestroyPushL( updated );

    for ( TInt i = 0 ; i < stream->CodecCount() ; ++i )
        {
        CMceComAudioCodec* update = stream->CodecL( i );
        TBool isUpdated = EFalse;
        TInt j = 0;

        while( !isUpdated && j < CodecCount() )
            {
            CMceComAudioCodec* codec = CodecL( j );
            if ( codec->Id() == update->Id() )
                {
                codec->UpdateL( *update );
                stream->RemoveCodecFromListL( i );
                delete update;
                updated.AppendL( codec );
                RemoveCodecFromListL( j );
                i--;
                isUpdated = ETrue;
                }
            j++;
            }
        }
        
    if ( CodecCount() > 0 )	//	Codecs have been removed
        {
        Session()->IsStructureChanged() = ETrue;
        }
        
    DestroyCodecs();
    
    while( updated.Count() > 0 )
        {
        AddCodecL( updated[0] );
        updated.Remove( 0 );
        }
        
    CleanupStack::PopAndDestroy();	// updated
            
    if ( stream->CodecCount() > 0 )	// Streams have been added
        {
        Session()->IsStructureChanged() = ETrue;
            
        while( stream->CodecCount() > 0 )
            {
            CMceComAudioCodec* add = stream->CodecL( 0 );
            AddCodecL( add );
            stream->RemoveCodecFromListL( 0 );
            }
        }
    }
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
CAlfSrvDisplaySubSession::CAlfSrvDisplaySubSession( 
    CAlfAppSrvSessionBase& aSession,
    const TRect& aRect,
    TInt aWindowGroupId,
    TInt aDisplayType,
    const TUid& aBufferUid) 
    : CAlfSrvSubSessionBase( aSession ),
      iDisplayType(aDisplayType), 
      iScreenBufferUid(aBufferUid),
      iRect(aRect), 
      iDisplayClearBackground(CHuiDisplay::EClearWithSkinBackground),
      iDisplayRenderingQuality(EHuiQualityAccurate),
      iDisplayUseDepthTest(EFalse),
      iDisplayUsage(0)
      
    {
    if (!IsTvOut())
        {
        // Note: Might not work if there are multiple displays: the client drawing area is set
        // according to the last display. Also the new area is left there even if  ConstructL() 
        // fails(!).
        static_cast<CAlfAppSrvSession&>(Session()).SetClientDrawingArea( aRect );
        aSession.SetClientWindowGroupId( aWindowGroupId );           
        Session().AlfAppUi()->SetAlfAppWindowGroup(aWindowGroupId);
        }    
    }
void UDP_NetListener::addHost(const IPaddress & addr)
{
	SDL_LockMutex(sessionsMutex);

	//prefer using an unused entry prior to starting a new one; also see if host already is in list
	SessionVector::iterator unusedIt = sessions.end();
	bool alreadyExists = false;
	for (SessionVector::iterator it = sessions.begin(), end = unusedIt; it != end; ++it) {
		if (it->used) {
			if ((it->addr.host == addr.host) && (it->addr.port == addr.port)) {
				alreadyExists = true;
				unusedIt = it;
				break;
			}
		}
		else {
			unusedIt = it;
		}
	}

	if (!alreadyExists) {
		if (unusedIt == sessions.end()) {
			sessions.push_back(Session(addr, "???"));
			unusedIt = --sessions.end(); //I think it already does but better avoid a potential bug if I'm incorrect...
		}
		else {
			*unusedIt = Session(addr, "???");
		}
	}

	unusedIt->removable = false;

	SDL_UnlockMutex(sessionsMutex);
}
예제 #5
0
CMsvOperation* CTextMtmClient::ForwardL(TMsvId aForwardEntryId, TMsvPartList aPartList, 
										TRequestStatus& aCompletionStatus)
// Create forwarded message 
// Destination folder is aForwardEntryL
//
	{
	__ASSERT_DEBUG(iMsvEntry!=NULL,gPanic(ETxtcNoCMsvEntrySet));
	__ASSERT_DEBUG(iMsvEntry->Entry().iType.iUid == KUidMsvMessageEntryValue, gPanic(ETxtcEntryTypeNotSupported));
	__ASSERT_DEBUG(iMsvEntry->Entry().iServiceId == KMsvLocalServiceIndexEntryId, gPanic(ETxtcInvalidServiceId));
	
	// Create the forwarded index entry
	TMsvEntry forwardEntry;
	forwardEntry.iMtm = KUidMsgTypeText;
	forwardEntry.iServiceId = Entry().Entry().iServiceId;
	forwardEntry.iType = KUidMsvMessageEntry;
	forwardEntry.iDetails.Set(iMsvEntry->Entry().iDetails);				
	forwardEntry.iSize = iMsvEntry->Entry().iSize;	
	if(aPartList&KMsvMessagePartDate)
		forwardEntry.iDate.HomeTime();
	if(aPartList&KMsvMessagePartDescription)
		forwardEntry.iDescription.Set(iMsvEntry->Entry().iDescription);		

	// Get CMsvEntry for destination (parent)
	CMsvEntry* cEntry = CMsvEntry::NewL(Session(), aForwardEntryId, TMsvSelectionOrdering());
	CleanupStack::PushL(cEntry);
	// Synchronously create new child
	CMsvOperationActiveSchedulerWait* wait = CMsvOperationActiveSchedulerWait::NewLC();
	CMsvOperation* opert = cEntry->CreateL(forwardEntry, wait->iStatus);
	CleanupStack::PushL(opert);
	wait->Start();
	User::LeaveIfError(opert->iStatus.Int());
	// Check result
	TPckgBuf<TMsvLocalOperationProgress> progressPack;
    progressPack.Copy(opert->ProgressL());
	TMsvLocalOperationProgress progress = progressPack();
	User::LeaveIfError(progress.iError);
	CleanupStack::PopAndDestroy(2);	// opert, wait

	// Get CMsvEntry for new entry
	TMsvId forwardId=progress.iId;
	cEntry->SetEntryL(forwardId);
	
	// Populate new forwarded message with Body text
	if(aPartList&KMsvMessagePartBody)
		{
		CMsvStore* store=cEntry->EditStoreL();
		CleanupStack::PushL(store);
		StoreBodyL(*store);				// Current context is original message
		store->CommitL();
		CleanupStack::PopAndDestroy();	// store
		}

	CleanupStack::PopAndDestroy(); // cEntry
		
	// Request was performed synchronously, so return a completed operation object
	return CMsvCompletedOperation::NewL(Session(), KUidMsgTypeText, progressPack, 
		KMsvNullIndexEntryId, aCompletionStatus);
	}
예제 #6
0
CMsvOperation* CSmtpClientMtm::InvokeAsyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection,
													TDes8& aParameter, TRequestStatus& aCompletionStatus)
/** Invokes asynchronous SMTP-specific operations.

@param aFunctionId Specifies which operation to perform e.g. connect, copy 
new mail etc. The specific operations are defined by the TSmtpCmds enumeration. 
@param aSelection A selection of messages that need to be copied/moved to a 
local folder. The first entry in this selection MUST be the service. 
@param aParameter Not used
@param aCompletionStatus The status when the operation completes. 
@leave KErrNotFound The selection of email to be moved or copied is empty
@leave KErrNotSupported The specified operation is not recognised
@return If successful, this is an asynchronously completing operation. If failed, 
this is a completed operation, with status set to the relevant error code. 
@see TSmtpCmds */
	{
	switch(aFunctionId)
		{
	case KMTMStandardFunctionsSendMessage:
		return CMsvSmtpProgressOperation::NewL(Session(), aSelection, KSMTPMTMSendOnNextConnection, aParameter, aCompletionStatus);
	case KSMTPMTMSendOnNextConnection:
		return (Session().TransferCommandL(aSelection, aFunctionId, aParameter, aCompletionStatus));
	case KSMTPMTMCreateNewEmailMessage:
	case KSMTPMTMCreateReplyEmailMessage:
	case KSMTPMTMCreateForwardEmailMessage:
	case KSMTPMTMCreateForwardAsAttachmentEmailMessage:
	case KSMTPMTMCreateReceiptEmailMessage:
		{
		TImCreateMessageOptions createMessageOptions;	
		TPckgC<TImCreateMessageOptions> paramPack(createMessageOptions);
		paramPack.Set(aParameter);
		switch (aFunctionId)
			{
		case KSMTPMTMCreateNewEmailMessage:
			return iImEmailOperation->CreateNewL(aCompletionStatus, iMsvEntry->Session(), aSelection[0], paramPack().iMsvPartList, paramPack().iMsvEmailTypeList, paramPack().iMessageType);
		case KSMTPMTMCreateReplyEmailMessage:
			return iImEmailOperation->CreateReplyL(aCompletionStatus, iMsvEntry->Session(), aSelection[1], aSelection[0], paramPack().iMsvPartList, paramPack().iMsvEmailTypeList, paramPack().iMessageType);
		case KSMTPMTMCreateForwardEmailMessage:
			return iImEmailOperation->CreateForwardL(aCompletionStatus, iMsvEntry->Session(), aSelection[1], aSelection[0], paramPack().iMsvPartList, paramPack().iMsvEmailTypeList, paramPack().iMessageType);
		case KSMTPMTMCreateForwardAsAttachmentEmailMessage:
			return iImEmailOperation->CreateForwardAsAttachmentL(aCompletionStatus, iMsvEntry->Session(), aSelection[1], aSelection[0], paramPack().iMsvPartList, paramPack().iMsvEmailTypeList, paramPack().iMessageType);
		case KSMTPMTMCreateReceiptEmailMessage:
			return iImEmailOperation->CreateReceiptL(aCompletionStatus, iMsvEntry->Session(), aSelection[1], aSelection[0], paramPack().iMsvPartList, paramPack().iMsvEmailTypeList, paramPack().iMessageType);
			}
		}
	break;
	default:
		User::Leave(KErrNotSupported);
		};
	return NULL;
	}
예제 #7
0
Session SessionPool::get(SessionPool::SessionDataPtr &session_data_ptr)
{
	Poco::Mutex::ScopedLock lock(_mutex);
    if (_shutdown) throw InvalidAccessException("Session pool has been shut down.");
	
	purgeDeadSessions();

	if (_idleSessions.empty())
	{
		Session newSession(SessionFactory::instance().create(_connector, _connectionString));
		applySettings(newSession.impl());

		PooledSessionHolderPtr pHolder(new PooledSessionHolder(*this, newSession.impl()));
		session_data_ptr.assign(new SessionData);
		session_data_ptr->session = pHolder;

		_idleSessions.push_front(session_data_ptr);
		++_nSessions;
	}

	PooledSessionHolderPtr pHolder(_idleSessions.front()->session);
	PooledSessionImplPtr pPSI(new PooledSessionImpl(pHolder));
	
	_activeSessions.push_front(std::move(_idleSessions.front()));
	_idleSessions.pop_front();
	
	if (session_data_ptr.isNull())
	{
		session_data_ptr.assign(_activeSessions.front());
	}

	return Session(pPSI);
}
// ---------------------------------------------------------------------------
// Sets background clear mode.
// ---------------------------------------------------------------------------
//    
void CAlfSrvDisplaySubSession::SetClearBackgroundL( const RMessage2& aMessage )
    {
    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
    // Parse parameters

    // 1: clear background (in)
    const TInt clearBackground = aMessage.Int1();
            
    if ( session.IsFocused() )
        {
        // Clear the background items, those are not used in this case
        iBackgroundItems.Reset();

        // Set background
        TRAPD(err, Display().SetClearBackgroundL( CHuiDisplay::TClearMode( clearBackground )) );
        // Don't let client see timeout errors from our internal services implementation
        if( err != KErrNone && err != KErrTimedOut ) 
            {
            User::Leave(err);
            }
        }
    
    // Complete
    aMessage.Complete( KErrNone );
    
    // Store value for this client
    iDisplayClearBackground = clearBackground;
    }
예제 #9
0
int main( int argc, char **argv )
{
    _DBG( ( "Calling ads_init()\r\n" ) );
    ads_init( argc, argv );
    _DBG( ( "After ads_init()\r\n" ) );

#else

int main( void )
{

#endif

    _DBG(("Calling Initialize\n"));
    Initialize();
    _DBG(("Calling RemoteConnect\n"));
    RemoteConnect();
    _DBG(("Calling Session\n"));
    Session();
    _DBG(("Calling TrapFini\n"));
    TrapFini();
    _DBG(("Calling RemoteDisco\n"));
    RemoteDisco();
    _DBG(("Calling RemoteUnLink\n"));
    RemoteUnLinkX();
    _DBG(("After calling RemoteUnLink\n"));
#ifdef ACAD
    LetACADDie();
#endif
    return( 0 );
}
// ---------------------------------------------------------
// CPosLmLocalDatabaseManager::ListDatabasesL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CPosLmLocalDatabaseManager::ListDatabasesL(
    RPointerArray<HPosLmDatabaseInfo>& aDatabaseInfoArray)
    {
    // list URIs
    CDesCArray* dbUriArray = ListDatabasesLC();
    // list registered databases
    Session().ListDatabasesL(aDatabaseInfoArray, KFileProtocol);
    // delete from URI list those databases that are registered
    for (TInt i = aDatabaseInfoArray.Count() - 1; i >= 0; i--)
        {
        TInt index;
        if (dbUriArray->Find(aDatabaseInfoArray[i]->DatabaseUri(), index) == 0)
            {
            dbUriArray->Delete(index);
            }
        }

    // for each remaining URI in the list, fill in database info
    // and add to list
    TInt count = dbUriArray->Count();
    for (TInt i = 0; i < count; i++)
        {
        HPosLmDatabaseInfo* info = HPosLmDatabaseInfo::NewLC((*dbUriArray)[i]);
        aDatabaseInfoArray.AppendL(info);
        CleanupStack::Pop(info); // transfer of ownership to array
        }

    CleanupStack::PopAndDestroy(dbUriArray);
    // database drive, database media and default flag
    // will be filled in by database management provider.
    }
/** Adds a filter to the session's filter queue.  

	Note: This function only adds filters; it doesn't replace or
	otherwise affect any pre-existing filters.

	@pre The session is open and no transactions have been created yet.
	@param aFilter The filter to add
	@param aEvent The event that triggers this filter (or all)
	@param aHeader The header whose presence triggers this filter
	(or KNullDesC for any) 
	@param aStatusCode The status code that triggers this filter
	(or -1 for all) 
	@param aPosition The position of the filter in the
	queue. Standard values are documented in the documentation for
	the supplied filters, and are based on the standard defines in
	MHTTPFilter::TPositions
	@param aName  the name of the Filter to add
	@see See MHTTPFilter::TPositions 
*/
EXPORT_C void RHTTPFilterCollection::AddFilterL(MHTTPFilter& aFilter,
												THTTPEvent aEvent,
												RStringF aHeader,
												TInt aStatusCode, 
												TInt aPosition,
												RStringF aName)
	{
	// You're only allowed to add filters if there aren't any transactions.
	__ASSERT_DEBUG(iImplementation->CanAddFilters(),HTTPPanic::Panic(HTTPPanic::EAddingFilterWithOutstandingTransactions));
	// You're only allowed to add filters between the protocol handler
	// and the client
	__ASSERT_DEBUG(aPosition >= MHTTPFilter::EProtocolHandler &&
				   aPosition <= MHTTPFilter::EClient,
				   HTTPPanic::Panic(HTTPPanic::EFilterInvalidPosition));

	// Copy the strings for use by this filter.
	aHeader.Copy();
	aName.Copy();
	
	//In case Leave happens when inserting filter in array that has reference of above variables,
	//their reference count needs to be decremented. So push onto CleanupStack.
	CleanupClosePushL(aHeader);
	CleanupClosePushL(aName);	
	
	THTTPFilterRegistration r(aFilter, aEvent, aHeader, aStatusCode, 
							  aPosition, aName, 
							  iImplementation->NextFilterHandle());
	User::LeaveIfError(iImplementation->FilterQueue().InsertInSignedKeyOrderAllowRepeats(r));
	
	CleanupStack::Pop(2); // aName, aHeader
	
	THTTPFilterHandle h;
	h.iValue = r.iHandle;
	aFilter.MHFLoad(Session(), h);
	}
예제 #12
0
void CSmtpClientMtm::InvokeSyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TDes8& aParameter)
/** Invokes a synchronous SMTP-specific operation.

@param aFunctionId Specifies which operation to perform. The only valid ID is KSMTPMTMIsConnected.
@param aSelection A selection of messages for the operation.
@param aParameter Not used
*/
	{
	__ASSERT_DEBUG(iMsvEntry!=NULL,gPanic(ESmtcMTMNoCMsvEntrySet));

	TInt error = KErrNone;
	switch (aFunctionId)
		{
		case KSMTPMTMIsConnected:
			{
			TPckgBuf<TImSmtpProgress> progress;
			Session().TransferCommandL(aSelection, KSMTPMTMIsConnected, aParameter, progress);
			aParameter.Copy(progress);
			return;
			}
		default:
			error=KErrNotSupported;
			__ASSERT_DEBUG(EFalse,gPanic(ESmtcUnknownSyncFunction));
		}

	User::LeaveIfError(error);
	}
예제 #13
0
void QtopiaMediaProvider::createSession
(
 QString const& responseChannel,
 QMediaSessionRequest const& request
)
{
    qLog(Media) << "QtopiaMediaProvider::createSession()" << request.id() << request.domain() << request.type();

    QMediaServerSession*    mediaSession = d->sessionManager->createSession(request);

    if (mediaSession != 0)
    {
        // Wrap in Media API content & control objects
        MediaContentServer* contentServer = new MediaContentServer(mediaSession,
                                                                   QMediaHandle(request.id()));
        MediaControlServer* controlServer = new MediaControlServer(mediaSession,
                                                                   QMediaHandle(request.id()));

        d->sessionMap.insert(request.id(), Session(contentServer, controlServer));

        QtopiaIpcEnvelope   e(responseChannel, "sessionCreated(QUuid)");
        e << request.id();
    }
    else
    {
        QtopiaIpcEnvelope   e(responseChannel, "sessionError(QUuid,QString)");
        e << request.id() << tr("The media system is not configured to handle this request");
    }
}
예제 #14
0
Session SessionPool::get()
{
	Poco::Mutex::ScopedLock lock(_mutex);
    if (_shutdown) throw InvalidAccessException("Session pool has been shut down.");
	
	purgeDeadSessions();

	if (_idleSessions.empty())
	{
		if (_nSessions < _maxSessions)
		{
			Session newSession(SessionFactory::instance().create(_connector, _connectionString));
			applySettings(newSession.impl());
			customizeSession(newSession);

			PooledSessionHolderPtr pHolder(new PooledSessionHolder(*this, newSession.impl()));
			_idleSessions.push_front(pHolder);
			++_nSessions;
		}
		else throw SessionPoolExhaustedException(_connector);
	}

	PooledSessionHolderPtr pHolder(_idleSessions.front());
	PooledSessionImplPtr pPSI(new PooledSessionImpl(pHolder));
	
	_activeSessions.push_front(pHolder);
	_idleSessions.pop_front();
	return Session(pPSI);
}
예제 #15
0
Session SessionLoaderLegacyXml::load(const QString& filename)
{
    auto group = DisplayGroup::create(QSizeF(1.0, 1.0));
    group->replaceWindows(_loadWindows(filename));
    return Session(Scene::create(std::move(group)), filename,
                   LEGACY_FILE_VERSION);
}
// ---------------------------------------------------------------------------
// Gets display rendering quality
// ---------------------------------------------------------------------------
//    
void CAlfSrvDisplaySubSession::QualityL( const RMessage2& aMessage )
    {
    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
    
    // Parse parameters

    // 2: quality (out)
    THuiQuality value = EHuiQualityAccurate;
    TPckg<THuiQuality> valuePckg(value); 

    if ( KAlfSrvClientQualitySupport && session.IsFocused() )
        {
        // Get quality
        value = Display().Quality();    
        }
    else
        {
        value = THuiQuality(iDisplayRenderingQuality);
        }
    
    // Write parameters
    aMessage.Write(2,valuePckg);
    
    // Complete
    aMessage.Complete( KErrNone );    
    }
// ---------------------------------------------------------
// CPosLmLocalDatabaseManager::ModifyDatabaseSettingsL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CPosLmLocalDatabaseManager::ModifyDatabaseSettingsL(
    const TDesC& aDatabaseUri,
    const TPosLmDatabaseSettings& aDatabaseSettings
        )
    {
    // validate URI
    HBufC* uri = PosLmDatabaseUtility::CreateDatabaseUriL(aDatabaseUri);
    CleanupStack::PushL(uri);

    if(!DatabaseExistsL(*uri))
        {
        User::Leave(KErrNotFound);
        }

    TChar drive = DatabaseDrive(*uri);
    TInt err = Session().ModifyDatabaseSettings(*uri,
                                                aDatabaseSettings,
                                                drive);
    if (err == KErrNotFound)
        {
        // database was not registered
        HPosLmDatabaseInfo* info =
            HPosLmDatabaseInfo::NewLC(*uri);
        info->Settings() = aDatabaseSettings;
        PosLmDbInfoExtension::SetDatabaseDrive(*info, drive);
        User::LeaveIfError(Session().RegisterDatabase(*info));
        CleanupStack::PopAndDestroy(info);
        }
    else if (err != KErrNone)
        {
        User::LeaveIfError(err);
        }

    // report event

    // To remove a warning, the event must be default constructed.
    TPosLmDatabaseEvent event =
        {
        EPosLmDbSettingsModified,
        {0,0,0,0,0,0,0,0}
        };

    User::LeaveIfError(Session().ReportEvent(event, *uri));

    CleanupStack::PopAndDestroy(uri);
    }
예제 #18
0
Session SessionsModel::session(int index) const
{
    if (index < 0 || index >= mSessions.count())
    {
        return Session();
    }

    return mSessions[index];
}
예제 #19
0
bool Session( void )
{
    unsigned    req;
    bool        want_return;

    Out[0].len = sizeof( RWBuff );
    Out[0].ptr = RWBuff;
    for( ;; ) {
#ifdef __WINDOWS__
        NothingToDo();
#endif
        In[0].len = GetPacket();
        In[0].ptr = GetPacketBuffPtr();
        In_Mx_Ptr = &In[0];
        Out_Mx_Ptr = &Out[0];
        In_Mx_Num = 1;
        Out_Mx_Num = 1;
        req = TRP_REQUEST( In );
        TRP_REQUEST( In ) &= ~0x80;
        if( req & 0x80 ) {
            req &= ~0x80;
            want_return = false;
        } else {
            want_return = true;
        }
        switch( req ) {
        case REQ_CONNECT:
            if( !AccConnect() )
                return( true );
            break;
        case REQ_DISCONNECT:
            AccTrap( false );
            return( true );
        case REQ_SUSPEND:
            AccTrap( false );
            RemoteDisco();
            for(;;) {
                while( !RemoteConnect() )
                    ;
                if( !Session() )
                    break;
                RemoteDisco();
            }
            break;
        case REQ_RESUME:
            AccTrap( false );
            return( false );
        case REQ_PROG_LOAD:
            AccLoadProg();
            break;
        default:
            AccTrap( want_return );
            break;
        }
    }
}
// ---------------------------------------------------------------------------
// Sets display dirty
// ---------------------------------------------------------------------------
//    
void CAlfSrvDisplaySubSession::SetDirtyL( const RMessage2& aMessage )
    {
    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
    
    if ( session.IsFocused() )
        {
        Display().SetDirty();    
        }
    
    // Complete
    aMessage.Complete( KErrNone );    
    }
// ---------------------------------------------------------------------------
// Sets visible area.
// ---------------------------------------------------------------------------
//
void CAlfSrvDisplaySubSession::SetVisibleAreaL( const RMessage2& aMessage, TBool aForce )
    {
    // Parse parameters

    // 1: area rect (in)
    TRect rect;
    TPckg<TRect> rectPckg(rect); 
    aMessage.Read(1,rectPckg);
	        
		CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());	        
	           
    // Set clipping rect for display visible area to e.g. avoid unnecesssary 
    // drawing under Avkon status/control pane areas. TV out does not show
    // those so no clipping in that case.
    if (UseVisualAreaClipping())
       {
       iRect = rect;
		
			if ( session.IsFocused() )
        		{
    	      TRect clipped = Session().AlfAppUi()->Container()->Rect();
#ifndef SYMBIAN_BUILD_GCE
		       	if (clipped.Intersects(rect))
		           {
		           clipped.Intersection(rect);        
		           }
#endif           
		       	iDisplay->SetVisibleAreaClippingRect(clipped);        
		       	iDisplay->SetDirty();
	        	}
	       }           
	           
    // Set visible area        
			if ( session.IsFocused() || aForce )
        		{
    		    static_cast<CAlfAppSrvSession&>(Session()).SetClientDrawingArea( rect );
        		}
    // Complete
    aMessage.Complete( KErrNone );
    }
/** Removes all filter registrations of the specified name.
	
	@param aFilter Filter name to remove.
 */
EXPORT_C void RHTTPFilterCollection::RemoveFilter(RStringF aFilter)
	{
	// Iterate through the filters and remove all the ones with the
	// given name. (We do this backwards, so that indexes in the
	// unsearched part of the array aren't affected by deletions)
	RArray<THTTPFilterRegistration>& filterQueue = 
		iImplementation->FilterQueue();
	TInt i = filterQueue.Count() -1;
	RStringPool strP = Session().StringPool();
	for (;i >= 0; --i)
		{
		if (filterQueue[i].iName == aFilter)
			{
			THTTPFilterHandle h;
			h.iValue = filterQueue[i].iHandle;
			filterQueue[i].iFilter->MHFUnload(Session(), h);
			strP.StringF(filterQueue[i].iHeader).Close();
			strP.StringF(filterQueue[i].iName).Close();
			filterQueue.Remove(i);
			}
		}
	}
예제 #23
0
CMsvOperation* CSmtpClientMtm::ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus)
/** Creates a forwarded message from the current message context. 

@return	If successful, this is an asynchronously completing forward message operation. 
If failed, this is a completed operation, with status set to the relevant error code. 		
@param aDestination The entry to which to assign the forwarded message 
@param aPartList Defines the parts that are to be copied from the original message into the forwarded message 
@param aCompletionStatus The request status to be completed when the operation has finished 
*/
	{
	TMsvEmailTypeList msvEmailTypeList = 0;
	TUid messageType = KUidMsgTypeSMTP;
	return CImEmailOperation::CreateForwardL(aCompletionStatus, Session(), iMsvEntry->EntryId(), aDestination, aPartList, msvEmailTypeList, messageType);
	}
// ---------------------------------------------------------------------------
// Sets visual content for the window
// ---------------------------------------------------------------------------
//    
void CAlfSrvDisplaySubSession::SetClientWindowForDrawingL( const RMessage2& aMessage )
    {
    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
    
    // Parse parameters

    // 1: TUint (in)
    TInt3 data(0,0,0);
    TPckg<TInt3> dataPckg(data); 
    aMessage.Read(1,dataPckg);    
    
    // Update value even if the client is not in focus
    
    CHuiVisual* visual = NULL;
    TInt visualHandle = data.iInt3;
    if (visualHandle)
    	{
    	visual = (CHuiVisual*) Session().GetInterfaceL(EHuiObjectTypeVisual, visualHandle);
    	}
		Session().AlfAppUi()->SetClientWindowForDrawingL(data.iInt1, data.iInt2, visual);
    
    // Complete
    aMessage.Complete( KErrNone );    
    }
예제 #25
0
bool SessionModel::add(const QDateTime& start, const QDateTime& stop, const QString& task)
{
	if (stop < start) {
		return false;
	}

	if (start.date() == stop.date()) {
		return add(Session(start.date(), start.time(), stop.time(), task, false));
	} else {
		if (!add(Session(start.date(), start.time(), QTime(23, 59, 59), task, false))) {
			return false;
		}
		QDate date = start.date();
		while ((date = date.addDays(1)) != stop.date()) {
			if (!add(Session(date, QTime(0, 0, 0), QTime(23, 59, 59), task, false))) {
				return false;
			}
		}
		if (!add(Session(stop.date(), QTime(0, 0, 0), stop.time(), task, false))) {
			return false;
		}
		return true;
	}
}
예제 #26
0
void CTAlloc::RunTestCaseL(TInt aCurTestCase)
	{
	((CTAllocStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
	switch(aCurTestCase)
		{
	case 1:
		((CTAllocStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0511"));
		Session();
		break;
	case 2:
		{
/**
	@SYMTestCaseID GRAPHICS-FBSERV-0611
*/
		((CTAllocStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0611"));
		TInt ret = RFbsSession::Connect();
		TEST2(ret, KErrNone);
		iFbs = RFbsSession::GetSession();
		TEST(iFbs != NULL);
		}
		break;
	case 4:
		((CTAllocStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0512"));
		BitmapsL();
		break;
	case 5:
		((CTAllocStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0514"));
		BitmapHandlerL();
		break;
	case 6:
		((CTAllocStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0513"));
		TypefaceStoreL();
		break;
	case 7:
		((CTAllocStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0515"));
		FontStoreL();
		break;
	case 8:
		((CTAllocStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
		((CTAllocStep*)iStep)->CloseTMSGraphicsStep();
		TestComplete();
		break;
	default:
		((CTAllocStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
		break;
		}
	((CTAllocStep*)iStep)->RecordTestResultL();
	}
예제 #27
0
int main( int argc, char **argv )
{
    char key;

#ifndef __WATCOMC__
    _argc = argc;
    _argv = argv;
#endif

    Initialize();
    OpeningStatement();
    for( ;; ) {
        Output( TRP_MSG_press_q );
        Output( "\r\n" );
        for( ;; ) {
            if( RemoteConnect() ) break;
            NothingToDo();
            if( KeyPress() ) {
                key = KeyGet();
                if( key == 'q' || key == 'Q' ) {
                    KillTrap();
                    RemoteUnLink();
                    SayGNiteGracey( 0 );
                }
            }
        }
        Output( TRP_MSG_session_started );
        Output( "\r\n\r\n" );
        Session();
#ifndef NETWARE
        /* flush keyboard input */
        while( KeyPress() )
            KeyGet();
#endif
        Output( "\r\n\r\n" );
        Output( TRP_MSG_session_ended );
        Output( "\r\n\r\n" );
        RemoteDisco();
        if( OneShot ) {
            KillTrap();
            RemoteUnLink();
            SayGNiteGracey( 0 );
        }
    }
    return( 0 );
}
예제 #28
0
bool SessionModel::edit(int pos, const Session& session)
{
	if (!session.isValid() || isBilled(pos)) {
		return false;
	}

	Q_ASSERT(pos < m_data.count());
	Session current = m_data.at(pos);

	// Replace session
	remove(pos);
	if (add(Session(session.date(), session.start(), session.stop(), session.task(), current.isBilled())) == false) {
		add(current);
		return false;
	} else {
		return true;
	}
}
// ---------------------------------------------------------------------------
// Returns the visible area.
// ---------------------------------------------------------------------------
//
void CAlfSrvDisplaySubSession::VisibleAreaL( const RMessage2& aMessage )
    {
    // Parse parameters

    // 2: area rect (out)
    TRect rect;
    TPckg<TRect> rectPckg(rect); 
    aMessage.Read(2,rectPckg);
            
    // Get visible area
    rect = static_cast<CAlfAppSrvSession&>(Session()).ClientDrawingArea();

    // Write parameters
    aMessage.Write(2,rectPckg);
    
    // Complete
    aMessage.Complete( KErrNone );
    }
예제 #30
0
Test::Session_ptr
Peer::create_session (Test::Session_Control_ptr control,
                      CORBA::ULong payload_size,
                      CORBA::ULong thread_count,
                      CORBA::ULong message_count,
                      CORBA::ULong peer_count)
{
  Session *session_impl = 0;
  ACE_NEW_THROW_EX (session_impl,
                    Session (control,
                             payload_size,
                             thread_count,
                             message_count,
                             peer_count),
                    CORBA::NO_MEMORY ());
  PortableServer::ServantBase_var transfer_ownership (session_impl);

  return session_impl->_this ();
}