JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
JMDIServer Class Referenceabstract

#include <JMDIServer.h>

Inheritance diagram for JMDIServer:
[legend]

Public Member Functions

 JMDIServer (const JUtf8Byte *signature)
 
virtual ~JMDIServer ()
 
void HandleCmdLineOptions (const int argc, char *argv[])
 
void CheckForConnections ()
 

Static Public Member Functions

static bool WillBeMDIServer (const JUtf8Byte *signature, const int argc, char *argv[])
 

Static Public Attributes

static const JUtf8BytekQuitOptionName = "--quit"
 

Protected Member Functions

bool IsFirstTime () const
 
virtual bool CanAcceptMDIRequest ()=0
 
virtual void PreprocessArgList (JPtrArray< JString > *argList)
 
virtual void HandleMDIRequest (const JString &dir, const JPtrArray< JString > &argList)=0
 

Detailed Description

Base class for handling Multiple Document Interface (MDI) requests.
It creates a UNIX domain socket so all jnew invocations of the application
will be passed to us (via WillBeMDIServer()).

If the application supports MDI, it must create a derived class and
construct it with a unique application signature.

The derived class must implement the following functions:

    CanAcceptMDIReqest
        Return false if the application is busy and cannot accept
        the request (e.g. due to re-entrancy problems).

    HandleMDIRequest
        The arguments to this function are the directory from which the
        MDI request was made and argv[].

Constructor & Destructor Documentation

◆ JMDIServer()

JMDIServer::JMDIServer ( const JUtf8Byte signature)

◆ ~JMDIServer()

JMDIServer::~JMDIServer ( )
virtual

Member Function Documentation

◆ CanAcceptMDIRequest()

virtual bool JMDIServer::CanAcceptMDIRequest ( )
protectedpure virtual

Implemented in JXMDIServer.

◆ CheckForConnections()

void JMDIServer::CheckForConnections ( )

By having an existing ACE_LSOCK_Stream, accept() is as fast as possible.

◆ HandleCmdLineOptions()

void JMDIServer::HandleCmdLineOptions ( const int  argc,
char *  argv[] 
)

Convenience function to convert the command line options from the first invocation of the program into an MDI request. This allows the argument parsing code to be in one place.

◆ HandleMDIRequest()

virtual void JMDIServer::HandleMDIRequest ( const JString dir,
const JPtrArray< JString > &  argList 
)
protectedpure virtual

◆ IsFirstTime()

bool JMDIServer::IsFirstTime ( ) const
inlineprotected

◆ PreprocessArgList()

void JMDIServer::PreprocessArgList ( JPtrArray< JString > *  argList)
protectedvirtual

Derived classes can override to remove options that only make sense for an initial invocation.

Reimplemented in JXMDIServer.

◆ WillBeMDIServer()

bool JMDIServer::WillBeMDIServer ( const JUtf8Byte signature,
const int  argc,
char *  argv[] 
)
static

If the application supports MDI, main() should call this before creating an application object. If this function returns false, main() can exit immediately.

Member Data Documentation

◆ kQuitOptionName

const JUtf8Byte * JMDIServer::kQuitOptionName = "--quit"
static

The documentation for this class was generated from the following files: