//
//
// Copyright (C) 2004 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2004 Pingtel Corp.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
//////////////////////////////////////////////////////////////////////////////

#ifndef RECYCLEDELETEDMSGSCGI_H
#define RECYCLEDELETEDMSGSCGI_H

// SYSTEM INCLUDES
//#include <...>

// APPLICATION INCLUDES
#include "os/OsDefs.h"
#include "mailboxmgr/CGICommand.h"

// DEFINES
// MACROS
// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STRUCTS
// TYPEDEFS
// FORWARD DECLARATIONS

/**
 * RecycleDeletedMsgsCGI Class
 *
 *      CGI for deleting messages in the 'Deleted' folder.
 *
 * @author Harippriya
 * @version 1.0
 */
class RecycleDeletedMsgsCGI : public CGICommand
{
public:
    /**
     * Ctor
     */
    RecycleDeletedMsgsCGI(  const UtlBoolean& requestIsFromWebUI,
                            const UtlString& m_mailboxIdentity,
                            const UtlString& messageIds,
                            const UtlString& nextblockhandle) ;

    /**
     * Virtual Dtor
     */
    virtual ~RecycleDeletedMsgsCGI();

    /** This does the work */
    virtual OsStatus execute (UtlString* out = NULL);

    OsStatus handleWebRequest( UtlString* out );

        OsStatus handleOpenVXIRequest( UtlString* out );

protected:

private:

        /** Fully qualified mailbox id of the user. For eg. sip:hari@pingtel.com */
    UtlString m_mailboxIdentity;

    /** Flag indicating if this CGI was called from the User UI */
    const UtlBoolean m_fromWeb ;

    // List of space separated message ids that need to be purged.
    UtlString m_messageids ;

    /** This variable is used to make sure that at the end of the edit,
        the right webpage is displayed (if there are more than one webpages used
        to display the contents of the single folder)
    */
    const UtlString m_nextBlockHandle ;
};

#endif //RECYCLEDELETEDMSGSCGI_H
