Skip to content
Snippets Groups Projects
Select Git revision
  • 5402e58e6bd57faaffd38fa15a11084e77d0426b
  • master default protected
  • release/202005
  • release/202001
  • release/201912
  • release/201911
  • release/releaseWindowsTestOne
  • release/windowsReleaseTest
  • release/releaseTest
  • release/releaseWindowsTest
  • release/201910
  • release/qt/201910
  • release/windows-test/201910
  • release/201908
  • release/201906
  • release/201905
  • release/201904
  • release/201903
  • release/201902
  • release/201901
  • release/201812
  • 4.0.0
  • 2.2.0
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.0
31 results

guiframework.h

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    guiframework.h 3.92 KiB
    /**
     *  Copyright (C) 2004-2005 Savoir-Faire Linux inc.
     *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
     *  Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com>
     *                                                                              
     *  This program is free software; you can redistribute it and/or modify
     *  it under the terms of the GNU General Public License as published by
     *  the Free Software Foundation; either version 2 of the License, or
     *  (at your option) any later version.
     *                                                                              
     *  This program is distributed in the hope that it will be useful,
     *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *  GNU General Public License for more details.
     *                                                                              
     *  You should have received a copy of the GNU General Public License
     *  along with this program; if not, write to the Free Software
     *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     */
    
    #ifndef __GUI_FRAMEWORK_H__
    #define __GUI_FRAMEWORK_H__
    /* Inherited class by GUI classes */
    /* The GuiFramework class is the base of all user interface */
    
    #include <string>
    #include "server/argtokenizer.h"
    #include "../observer.h"
    
    class GuiFramework {
    public:
    	GuiFramework ();
    	virtual ~GuiFramework (void);
    
    	/* Parent class to child class */
    	virtual int incomingCall (short id, const std::string& accountId, const std::string& from) = 0;
    	virtual void peerAnsweredCall (short id) = 0;
    	virtual void peerRingingCall (short id) = 0;
    	virtual void peerHungupCall (short id) = 0;
    	virtual void displayStatus (const std::string& status) = 0;
    	virtual void displayConfigError (const std::string& error) = 0;
    	virtual void displayTextMessage (short id, const std::string& message) = 0;
    	virtual void displayErrorText (short id, const std::string& message) = 0;
    	virtual void displayError (const std::string& error) = 0;
    	virtual void startVoiceMessageNotification (void) {}
    	virtual void stopVoiceMessageNotification (void) {}
      virtual void sendVoiceNbMessage(const std::string& nb_msg) = 0;
    	virtual void setup() = 0;
      virtual void sendMessage(const std::string& code, const std::string& seqId, TokenList& arg) = 0;
      virtual void sendCallMessage(const std::string& code, 
      const std::string& sequenceId, 
      short id, 
      TokenList arg) = 0;
    
      virtual void callFailure(short id) = 0;
    
    	/* Child class to parent class */
    	int outgoingCall (const std::string& to); 	
    	int hangupCall (short id);
    	int cancelCall (short id);
    	int answerCall (short id);
    	int onHoldCall (short id);
    	int offHoldCall (short id);
    	int transferCall (short id, const std::string& to);
    	void mute ();
    	void unmute ();
    	void muteOn (short id);
    	void muteOff (short id);
    	int refuseCall (short id);
    
    	bool saveConfig (void);
    	int registerVoIPLink (void);
    	int unregisterVoIPLink (void);
    	int sendTextMessage (short id, const std::string& message);
    	int accessToDirectory (void);
    	bool sendDtmf (short id, char code);
      bool playDtmf (char code);
      bool playTone ();
      bool stopTone ();
    
      // config
      bool getZeroconf(const std::string& sequenceId);
      bool attachZeroconfEvents(const std::string& sequenceId, Pattern::Observer& observer);
      bool detachZeroconfEvents(Pattern::Observer& observer);
      bool getCallStatus(const std::string& sequenceId);
      bool getConfigAll(const std::string& sequenceId);
      bool getConfig(const std::string& section,  const std::string& name, TokenList& arg);
      bool setConfig(const std::string& section, const std::string& name, const std::string& value);
      bool getConfigList(const std::string& sequenceId, const std::string& name);
      bool setSpkrVolume(int volume);
      bool setMicVolume(int volume);
      int getSpkrVolume();
      int getMicVolume();
    
      bool hasLoadedSetup();
      // Observer methods
      short getCurrentId();
    
    protected:
    	std::string _message;
    };
    
    #endif // __GUI_FRAMEWORK_H__