//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / SIG
//
//File: sigmode.h
//
//Version: $Revision: 1.7 $
//
//State: $State: Exp $
//
//Date: $Date: 1999/03/10 09:34:05 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Sami Raatikainen
//
//Description:
//      Class sigMode is to be used by every signalling protocol to implement
//      state changes (and other possible actions) to hide differences
//      between user and network sides.
//      Usually a protocol will implement two modes inherited from sigMode;
//      a userMode and a networkMode, but there is no limitations except that
//      at least one mode has to be implemented.
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 

#ifndef __SIG_SIGMODE_H__
#define __SIG_SIGMODE_H__

#include "pf/types.h"

class pfState;
class pfMessenger;
class sigProtocol;

class sigMode
{
    public:
        static sigMode *instance(void);
        
        virtual bool isNetworkMode(void);
        virtual void setZeroEndpointReference(
            pfMessenger *message_,
            sigProtocol *sigprotocol_);
        
        virtual void setCallState(pfUlong value_);
        virtual pfUlong getCallState(void) const;
        
        // UNI modes
        virtual pfState *createNullState(void);
        virtual pfState *createCallInitiatedState(void);
        virtual pfState *createOutgoingCallProceedingState(void);
        virtual pfState *createCallDeliveredState(void);
        virtual pfState *createCallPresentState(void);
        virtual pfState *createCallReceivedState(void);
        virtual pfState *createUserConnectRequestState(void);
        virtual pfState *createNetworkConnectRequestState(void);
        virtual pfState *createIncomingCallProceedingState(void);
        virtual pfState *createActiveState(void);
        virtual pfState *createReleaseRequestState(void);
        virtual pfState *createReleaseIndicationState(void);


        // NNI modes
        virtual pfState *createIdleState(void);
        virtual pfState *createAwaitIAAState(void);
        virtual pfState *createAwaitACMState(void);
        virtual pfState *createAwaitANMState(void);
        virtual pfState *createAwaitAcceptedReqState(void);
        virtual pfState *createAwaitAnswerReqState(void);
        virtual pfState *createAwaitAddressCompReqState(void);
        virtual pfState *createCallAnsweredState(void);
        virtual pfState *createAwaitRLCState(void);
        virtual pfState *createAwaitReleaseRespState(void);
        virtual pfState *createRELCollisionState(void);

        
    protected:
        sigMode(void);
        virtual ~sigMode(void);
        
    private:
        static sigMode *_only;
        
        pfUlong _callState;
};

#endif // __SIG_SIGMODE_H__
