/**************************************************************************** * * $Id: * * Copyright (C) 1998-2000 RealNetworks. * All rights reserved. * * http://www.real.com/devzone * * This program contains proprietary information of RealNetworks, Inc., * and is licensed subject to restrictions on use and distribution. * * * Interface for the file observer to the log system, which will write received * log messages to the specified file. */ #ifndef _IRTAFILEOBSERVER_H #define _IRTAFILEOBSERVER_H enum enumLogFormat{ Detailed, Short }; enum enumRollType{ Monthly, Daily, Weekly, Hourly }; // {478D6411-A712-11d5-9374-00D0B749DE42} DEFINE_GUID(IID_IRTAFileObserver, 0x478d6411, 0xa712, 0x11d5, 0x93, 0x74, 0x0, 0xd0, 0xb7, 0x49, 0xde, 0x42); // {3E1AE821-A7B9-11d5-9374-00D0B749DE42} DEFINE_GUID(CLSID_RTAFileObserver, 0x3e1ae821, 0xa7b9, 0x11d5, 0x93, 0x74, 0x0, 0xd0, 0xb7, 0x49, 0xde, 0x42); #undef INTERFACE #define INTERFACE IRTAFileObserver /**************************************************************************** * * Interface: * * IRTAFileObserver * * Purpose: * * Interface for the file observer to the log system, which will write received * log messages to the specified file. * * IID_IRTAFileObserver: * * // {938F4A21-1327-11d5-9349-00D0B749DE42} * */ DECLARE_INTERFACE_(IRTAFileObserver, IUnknown) { /* * IUnknown methods */ STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /************************************************************************ * Method: * IRTAFileObserver::Init * Purpose: * Initialize the file observer. * Parameters: * szFilename - [in] Name of the file to write log messages to. * Returns: * PNR_OK - If success. * PNR_FAIL - Could not properly connect to the log system. */ STDMETHOD(Init)(THIS_ const char* /*IN*/ szFilename) PURE; /************************************************************************ * Method: * IRTAFileObserver::Enable * Purpose: * Enables and disables the observer from writing to the file. * Parameters: * bEnable - [in] Enable/Disable(TRUE/FALSE). * Returns: * PNR_OK - If success. * PNR_FAIL - State change unsuccessful. */ STDMETHOD(Enable)(THIS_ BOOL /*IN*/ bEnable) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetCategoryFilter * Purpose: * Tells the log system to only send log messages with log codes which * pass the bitmask parameter. * Parameters: * nCategoryFilter - [in] Bitmask for the accepted log codes. * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set category filter. */ STDMETHOD(SetCategoryFilter)(THIS_ UINT32 /*IN*/ nCategoryFilter) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetFuncAreaFilter * Purpose: * Tells the log system to only send log messages with functional areas * listed in the parameter string. * Parameters: * szFuncAreaList - [in] List of accepted functional areas. Format is: * "Namespace:FunctionalArea, ..." * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set functional area filter. */ STDMETHOD(SetFuncAreaFilter)(THIS_ const char* /*IN*/ szFuncAreaList) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetLanguage * Purpose: * Tells the log system what language to use when translating numeric * messages. **Currently Ignored** * Parameters: * szLanguage - [in] Desired translation language. * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set language. */ STDMETHOD(SetLanguage)(THIS_ const char* /*IN*/ szLanguage) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetFormat * Purpose: * Sets that format of how log messages are written to file. * Parameters: * format - [in] The desired format: Short or Detailed. * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set format. */ STDMETHOD(SetFormat)(THIS_ enumLogFormat /*IN*/ format) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetSeparator * Purpose: * Sets that seperator used to separate log message elements per log message. * Parameters: * cSep - [in] The separator character. * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set separator character. */ STDMETHOD(SetSeparator)(THIS_ char /*IN*/ cSep) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetSizeRoll * Purpose: * Tells the observer to roll the file it writes to after the specified * size is met. * Parameters: * nNumMB - [in] The number of megabytes the file must reach in order * to be rolled. * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set roll value. */ STDMETHOD(SetSizeRoll)(THIS_ UINT32 /*IN*/ nNumMB) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetTimeRoll * Purpose: * Tells the observer to roll the file at specific time intervals. * Parameters: * enumRollType - [in] Period over which the file is rolled. * nTime - [in] Ignored. * nInterval - [in] Ignored. * nTimeZone - [in] Ignored. * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set roll value. */ STDMETHOD(SetTimeRoll)(THIS_ enumRollType /*IN*/ rolltype, UINT32 /*IN*/ nTime, UINT32 /*IN*/ nInterval, INT32 /*IN*/ nTimeZone) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetFilename * Purpose: * Sets the filename the observer should write to. * Parameters: * szFilename - [in] Name of the file to be written to. * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set file. */ STDMETHOD(SetFilename)(THIS_ const char* /*IN*/ szFilename) PURE; /************************************************************************ * Method: * IRTAFileObserver::SetPreviousFilename * Purpose: * Sets the previous filename value (used in some rolling calculations). * Parameters: * szFilename - [in] Name of the previous file written to. * Returns: * PNR_OK - If success. * PNR_FAIL - Unable to set file. */ STDMETHOD(SetPreviousFilename)(THIS_ const char* /*IN*/ szFilename) PURE; /************************************************************************ * Method: * IRTAFileObserver::GetFilename * Purpose: * Gets the name of the file currently being written to. * Parameters: * NONE. * Returns: * Pointer to the name of the current file. */ STDMETHOD_(const char*, GetFilename)() PURE; /************************************************************************ * Method: * IRTAFileObserver::GetPreviousFilename * Purpose: * Gets the string being used as the previous file name. * Parameters: * NONE. * Returns: * Pointer to the name of the previous file. */ STDMETHOD_(const char*, GetPreviousFilename)() PURE; /************************************************************************ * Method: * IRTAFileObserver::Shutdown * Purpose: * Shuts down (unsubscribes and closes out the file) the observer. * Parameters: * NONE * Returns: * PNR_OK - Shutdown succeeded. * PNR_FAIL - Shutdown failed. */ STDMETHOD(Shutdown)( THIS ) PURE; /************************************************************************ * Method: * IRTAFileObserver::EnableSDKMessages * Purpose: * Tells the observer to accept or reject messages marked as SDK. * Parameters: * bEnable - [in] Enable SDK message reception. * Returns: * NONE */ STDMETHOD_(void, EnableSDKMessages)(BOOL bEnable) PURE; }; /**************************************************************************** * Function: * CreateFileObserver * Purpose: * Creates a file observer object and return the IRTAFileObserver interface * from the create object on success. */ typedef PN_RESULT (STDAPICALLTYPE *FPCREATEFILEOBSERVER)(IRTAFileObserver** ppIFileObserver); #endif