ihxtlogsystem.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:34k
源码类别:

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: ihxtlogsystem.h,v 1.1.2.3 2004/07/09 01:45:13 hubbe Exp $
  3.  * 
  4.  * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
  5.  * 
  6.  * The contents of this file, and the files included with this file,
  7.  * are subject to the current version of the RealNetworks Public
  8.  * Source License (the "RPSL") available at
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed
  10.  * the file under the current version of the RealNetworks Community
  11.  * Source License (the "RCSL") available at
  12.  * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
  13.  * will apply. You may also obtain the license terms directly from
  14.  * RealNetworks.  You may not use this file except in compliance with
  15.  * the RPSL or, if you have a valid RCSL with RealNetworks applicable
  16.  * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
  17.  * the rights, obligations and limitations governing use of the
  18.  * contents of the file.
  19.  * 
  20.  * Alternatively, the contents of this file may be used under the
  21.  * terms of the GNU General Public License Version 2 or later (the
  22.  * "GPL") in which case the provisions of the GPL are applicable
  23.  * instead of those above. If you wish to allow use of your version of
  24.  * this file only under the terms of the GPL, and not to allow others
  25.  * to use your version of this file under the terms of either the RPSL
  26.  * or RCSL, indicate your decision by deleting the provisions above
  27.  * and replace them with the notice and other provisions required by
  28.  * the GPL. If you do not delete the provisions above, a recipient may
  29.  * use your version of this file under the terms of any one of the
  30.  * RPSL, the RCSL or the GPL.
  31.  * 
  32.  * This file is part of the Helix DNA Technology. RealNetworks is the
  33.  * developer of the Original Code and owns the copyrights in the
  34.  * portions it created.
  35.  * 
  36.  * This file, and the files included with this file, is distributed
  37.  * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
  38.  * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
  39.  * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
  40.  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
  41.  * ENJOYMENT OR NON-INFRINGEMENT.
  42.  * 
  43.  * Technology Compatibility Kit Test Suite(s) Location:
  44.  *    http://www.helixcommunity.org/content/tck
  45.  * 
  46.  * Contributor(s):
  47.  * 
  48.  * ***** END LICENSE BLOCK ***** */
  49. #ifndef IHXTLOGSYSTEM_H
  50. #define IHXTLOGSYSTEM_H
  51. #include "hlxclib/stdarg.h"
  52. enum EHXTLogCode
  53. {
  54.     // Producer log codes
  55.     //
  56.     // Messages that application end-users or
  57.     // 3rd party SDK developers will see
  58.     LC_APP_DIAG  = 0x000000F0, // Less important/diagnostic messages (only interesting if something goes wrong)
  59.     LC_APP_INFO  = 0x7F000000, // Very important messages (always want to see these messages)
  60.     LC_APP_WARN  = 0x00FF0000, // There was a problem, but it was handled and everything is probably ok
  61.     LC_APP_ERROR = 0x0000FF00, // There was a problem -- it wasn't handled
  62.     // Messages that SDK users will see --
  63.     // ok to mention IHX/IHXT interfaces
  64.     LC_SDK_DIAG  = 0x000000F2, // Less important/diagnostic messages (only interesting if something goes wrong)
  65.     LC_SDK_INFO  = 0x7f000002, // Very important messages (always want to see these messages)
  66.     LC_SDK_WARN  = 0x00FF0002, // There was a problem, but it was handled and everything is probably ok
  67.     LC_SDK_ERROR = 0x0000FF02, // There was a problem -- it wasn't handled
  68.     // Messages that are only useful with the
  69.     // corresponding source code -- ok to mention
  70.     // internal classnames
  71.     LC_DEV_DIAG  = 0x000000F1, // Less important/diagnostic messages (only interesting if something goes wrong)
  72.     LC_DEV_INFO  = 0x7f000001, // Very important messages (always want to see these messages)  
  73.     LC_DEV_WARN  = 0x00FF0001, // There was a problem, but it was handled and everything is probably ok
  74.     LC_DEV_ERROR = 0x0000FF01, // There was a problem -- it wasn't handled
  75.     // Client-related log codes
  76.     LC_CLIENT_LEVEL1 = 0x00000001,
  77.     LC_CLIENT_LEVEL2 = 0x00000002,
  78.     LC_CLIENT_LEVEL3 = 0x00000004,
  79.     LC_CLIENT_LEVEL4 = 0x00000008
  80. };
  81. enum EHXTLogCodeFilterMask
  82. {
  83.     SDK_MESSAGE_MASK    = 0x00000002,
  84.     DIAG_MESSAGE_MASK   = 0x000000F0,
  85.     ERROR_MESSAGE_MASK  = 0x0000FF00,
  86.     WARN_MESSAGE_MASK   = 0x00FF0000,
  87.     INFO_MESSAGE_MASK   = 0x7F000000,
  88.     CLIENT_MSGMASK_ALL  = 0x0000000F,
  89.     CLIENT_MSGMASK_L1_2 = 0x00000003,
  90.     CLIENT_MSGMASK_L1_3 = 0x00000007
  91. };
  92. // Note: Only add new items to the end of the
  93. // list -- otherwise the FAs will get out of sync
  94. // with already compiled/released code and logmessages.xml
  95. enum EHXTLogFuncArea
  96. {
  97.     // Producer-related functional areas
  98.     NONE = 0,
  99.     ACTIVEX,
  100.     AUDCODEC,
  101.     AUDPREFIL,
  102.     BCAST,
  103.     CAPTURE,
  104.     CMDLINE,
  105.     FILEOUT,
  106.     FILEREAD,
  107.     GUI,
  108.     JOBFILE,
  109.     LIC,
  110.     POSFIL,
  111.     REMOTE,
  112.     FA_SDK_CONFIG,  // SDK config objects (typically rmsession)
  113.     FA_SDK_ENCODE,  // SDK encoding (typically encpipeline, streammanager)
  114.     FA_SDK_CORE,    // RSCore, RSUtil, RSGraphManager stuff
  115.     FA_GEN_FILTER,  // Generic filter msgs
  116.     STATS,
  117.     VIDCODEC,
  118.     VIDPREFIL,
  119.     VIDRENDR,
  120.     MEDIASAMPLES,
  121.     PUB,
  122.     // Client-related functional areas
  123.     HXLOG_GENE = 0x47454E45, // Generic
  124.     HXLOG_TRAN = 0x5452414E, // Transport
  125.     HXLOG_ASMX = 0x41534D58, // ASM
  126.     HXLOG_BAND = 0x42414E44, // Bandwidth manager
  127.     HXLOG_AUDI = 0x41554449, // RealAudio
  128.     HXLOG_VIDE = 0x56494445, // RealVideo
  129.     HXLOG_PIXX = 0x50495858, // RealPix
  130.     HXLOG_JPEG = 0x4A504547, // JPEG
  131.     HXLOG_GIFX = 0x47494658, // GIF
  132.     HXLOG_SWFX = 0x53574658, // Flash
  133.     HXLOG_SMIL = 0x534D494C, // SMIL
  134.     HXLOG_TURB = 0x54555242, // TurboPlay
  135.     HXLOG_SITE = 0x53495445, // Site
  136.     HXLOG_AUTO = 0x4155544F, // Auto-Update
  137.     HXLOG_RECO = 0x5245434F, // Reconnect
  138.     HXLOG_AUTH = 0x41555448, // Authentication
  139.     HXLOG_CORE = 0x434F5245, // Core load time
  140.     HXLOG_RTSP = 0x52545350, // RTSP
  141.     HXLOG_STRE = 0x53545245, // Stream source map
  142.     HXLOG_EVEN = 0x4556454E, // RealEvents
  143.     HXLOG_BUFF = 0x42554646, // Buffer Control
  144.     HXLOG_MP3X = 0x4D503358  // MP3
  145. };
  146. #include "hxtsmartpointer.h"
  147. /****************************************************************************
  148.  *
  149.  *  Interface:
  150.  *
  151.  *  IHXTLogObserver
  152.  *
  153.  *  Purpose:
  154.  *
  155.  *      IID_IHXTLogObserver:
  156.  *
  157.  *  This interface must be implemented by and object registering with the log
  158.  *  system to receive log messages.
  159.  *
  160.  *  // {EA6ABCF4-66EB-11d4-931A-00D0B749DE42}
  161.  *
  162.  */
  163. DEFINE_GUID(IID_IHXTLogObserver, 
  164. 0xea6abcf4, 0x66eb, 0x11d4, 0x93, 0x1a, 0x0, 0xd0, 0xb7, 0x49, 0xde, 0x42);
  165. #undef INTERFACE
  166. #define INTERFACE IHXTLogObserver
  167. DECLARE_INTERFACE_(IHXTLogObserver, IUnknown)
  168. {
  169.         /*
  170.          *      IUnknown methods
  171.          */
  172.         STDMETHOD(QueryInterface)               (THIS_
  173.                                 REFIID riid,
  174.                                 void** ppvObj) PURE;
  175.         STDMETHOD_(ULONG32,AddRef)              (THIS) PURE;
  176.         STDMETHOD_(ULONG32,Release)             (THIS) PURE;
  177.         /************************************************************************
  178.          *      Method:
  179.          *          IHXTLogObserverManager::OnEndService
  180.          *      Purpose:
  181.          *          The observer will receive this call as notification that the log system
  182.          *                      is shutting down, and that all log messages have been delivered.
  183.          *      Parameters:
  184.          *          NONE
  185.          *      Returns:
  186.          *          Ignored.
  187.          */
  188.   STDMETHOD(OnEndService) (THIS) PURE;
  189.         /************************************************************************
  190.          *      Method:
  191.          *          IHXTLogObserverManager::ReceiveMsg
  192.          *      Purpose:
  193.          *          Method called on an observer when a log message is sent to the log 
  194.          *                      system that passes the observers filter.
  195.          *      Parameters:
  196.          *          szNamespace - [in] The namespace used to qualify the functional area
  197.          *                                      and translated messge.
  198.          *          nCode - [in] The important level of the message.
  199.          *          unFuncArea - [in] numeric value used in the message as the functional area
  200.          *          szFuncArea - [in] The translated string for the numeric functional area, if
  201.          *                                      one was found.
  202.          *          nTimeStamp - [in] The time (in milliseconds since midnight, Jan.1, 1970) at 
  203.          *                                      which the log message was sent to the log system.
  204.          *          nMsg - [in] The numeric value used to identify the message for translation. 
  205.          *          szMsg - [in] The actual message text, either translation or the text sent
  206.          *                                      to the LogMessage method.
  207.          *          szJobName - [in] The name of the job from which the message originated.
  208.          *      Returns:
  209.          *          Ignored.
  210.          */
  211.   STDMETHOD(ReceiveMsg) (THIS_ 
  212.                 const char*                     /*IN*/                  szNamespace, 
  213.                 EHXTLogCode                                     /*IN*/                  nCode, 
  214.                 UINT32                                  /*IN*/                  unFuncArea, 
  215.                 const char*                     /*IN*/                  szFuncArea, 
  216.                 INT32                                           /*IN*/                  nTimeStamp, 
  217.                 UINT32                                  /*IN*/                  nMsg, 
  218.                 const char*             /*IN*/                  szMsg, 
  219.                 const char*             /*IN*/                  szJobName) PURE; 
  220. };
  221. HXT_MAKE_SMART_PTR(IHXTLogObserver)
  222. /****************************************************************************
  223.  *
  224.  *  Interface:
  225.  *
  226.  *  IHXTLogObserver2
  227.  *
  228.  *  Purpose:
  229.  *
  230.  *      IID_IHXTLogObserver2:
  231.  *
  232.  *  This interface must be implemented by an object registering with the log
  233.  *  system to receive log messages & support flusing.
  234.  *
  235.  *  // {68AFE313-BE30-4b46-BFAD-6F035E624C8A}
  236.  *
  237.  */
  238.  // {68AFE313-BE30-4b46-BFAD-6F035E624C8A}
  239. DEFINE_GUID(IID_IHXTLogObserver2, 
  240. 0x68afe313, 0xbe30, 0x4b46, 0xbf, 0xad, 0x6f, 0x3, 0x5e, 0x62, 0x4c, 0x8a);
  241. #undef INTERFACE
  242. #define INTERFACE IHXTLogObserver
  243. DECLARE_INTERFACE_(IHXTLogObserver2, IHXTLogObserver)
  244. {
  245.     /************************************************************************
  246.      *  Method:
  247.      *      IHXTLogObserver2::Flush
  248.      *  Purpose:
  249.      *      Called by LogObserverManager to inform the observer to flush any internal buffers.
  250.      *  Returns:
  251.      *      HXR_OK - If success.
  252.      *      HXR_FAIL - failure.
  253.      */
  254.     STDMETHOD(Flush)() PURE;
  255. };
  256. HXT_MAKE_SMART_PTR(IHXTLogObserver2)
  257. /****************************************************************************
  258.  *
  259.  *  Interface:
  260.  *
  261.  *  IHXTFuncAreaEnum
  262.  *
  263.  *  Purpose:
  264.  *
  265.  *  This is an enumeration interface which will enurmerate through all functional
  266.  *  areas pre-loaded by the log system.  
  267.  *
  268.  *      IID_IHXTFuncAreaEnum:
  269.  *
  270.  *  // {938F4A21-1327-11d5-9349-00D0B749DE42}
  271.  *
  272.  */
  273. DEFINE_GUID(IID_IHXTFuncAreaEnum, 
  274. 0x938f4a21, 0x1327, 0x11d5, 0x93, 0x49, 0x0, 0xd0, 0xb7, 0x49, 0xde, 0x42);
  275. #undef INTERFACE
  276. #define INTERFACE IHXTFuncAreaEnum
  277. DECLARE_INTERFACE_(IHXTFuncAreaEnum, IUnknown)
  278. {
  279.         /*
  280.          *      IUnknown methods
  281.          */
  282.         STDMETHOD(QueryInterface)               (THIS_
  283.                                 REFIID riid,
  284.                                 void** ppvObj) PURE;
  285.         STDMETHOD_(ULONG32,AddRef)              (THIS) PURE;
  286.         STDMETHOD_(ULONG32,Release)             (THIS) PURE;
  287.         /************************************************************************
  288.          *      Method:
  289.          *          IHXTFuncAreaEnum::GetFirst
  290.          *      Purpose:
  291.          *          Returns details about the first pre-loaded functional area and resets
  292.          *                      the enumerator to that position.
  293.          *      Parameters:
  294.          *          ppszNamespace - [out] Pointer to the pointer which will point to the text
  295.          *          of the namespace for this functional area.
  296.          *          pnNum - [out] Pointer to the integer which will be set to the numeric value
  297.          *          for this functional area.
  298.          *          ppszName - [out] Pointer to the pointer which will be set to the localized
  299.          *                                      translation of the text representing the functional area.
  300.          *      Returns:
  301.          *          HXR_OK - If success.
  302.          *          HXR_FAIL - No functional areas preloaded by the log system.
  303.          */
  304.         STDMETHOD (GetFirst) (THIS_
  305.                 const char**                    /*OUT*/                 ppszNamespace, 
  306.                 UINT32*                                         /*OUT*/                 pnNum, 
  307.                 const char**                    /*OUT*/                 ppszName) PURE;
  308.         /************************************************************************
  309.          *      Method:
  310.          *          IHXTLogObserverManager::OnEndService
  311.          *      Purpose:
  312.          *          Returns details about the next pre-loaded functional area.
  313.          *      Parameters:
  314.          *          ppszNamespace - [out] Pointer to the pointer which will point to the text
  315.          *          of the namespace for this functional area.
  316.          *          pnNum - [out] Pointer to the integer which will be set to the numeric value
  317.          *          for this functional area.
  318.          *          ppszName - [out] Pointer to the pointer which will be set to the localized
  319.          *                                      translation of the text representing the functional area.
  320.          *      Returns:
  321.          *          HXR_OK - If success.
  322.          *          HXR_FAIL - No more functional areas.
  323.          */
  324.         STDMETHOD (GetNext) (THIS_
  325.                 const char**                    /*OUT*/                 ppszNamespace, 
  326.                 UINT32*                                         /*OUT*/                 pnNum, 
  327.                 const char**                    /*OUT*/                 ppszName) PURE;
  328. };
  329. HXT_MAKE_SMART_PTR(IHXTFuncAreaEnum)
  330. /****************************************************************************
  331.  *
  332.  *  Interface:
  333.  *
  334.  *  IHXTLogObserverManager
  335.  *
  336.  *  Purpose:
  337.  *
  338.  *  This interface manages the subscription of observer objects to the log
  339.  *  system.
  340.  *
  341.  *      IID_IHXTLogObserverManager:
  342.  *
  343.  *  // {EA6ABCDC-66EB-11d4-931A-00D0B749DE42}
  344.  *
  345.  */
  346. DEFINE_GUID(IID_IHXTLogObserverManager, 
  347. 0xea6abcdc, 0x66eb, 0x11d4, 0x93, 0x1a, 0x0, 0xd0, 0xb7, 0x49, 0xde, 0x42);
  348. #undef INTERFACE
  349. #define INTERFACE IHXTLogObserverManager
  350. DECLARE_INTERFACE_(IHXTLogObserverManager, IUnknown)
  351. {
  352.         /*
  353.          *      IUnknown methods
  354.          */
  355.         STDMETHOD(QueryInterface)               (THIS_
  356.                                 REFIID riid,
  357.                                 void** ppvObj) PURE;
  358.         STDMETHOD_(ULONG32,AddRef)              (THIS) PURE;
  359.         STDMETHOD_(ULONG32,Release)             (THIS) PURE;
  360.         /************************************************************************
  361.          *      Method:
  362.          *          IHXTLogObserverManager::Subscribe
  363.          *      Purpose:
  364.          *          Adds an observer to the log system which will receive log messages, and
  365.          *                      initializes it with the parameter values.
  366.          *      Parameters:
  367.          *          pUnknown - [in] IUnknown pointer to the observer object which must 
  368.          *                                      support a QueryInterface for the IHXTLogObserver interface.
  369.          *          szFilterStr - [in] XML string specifying an initial filter for this
  370.          *                                      observer.
  371.          *          szLocale - [in] Language in which the observer wishes to receive log 
  372.          *                                      messages.  **Currently ignored**
  373.          *          bCatchup - [in] Indicates whether the observer wishes to receive all
  374.          *                                      log messages (up to 1000) previously delivered by the log system
  375.          *                                      prior to this observers subscription.
  376.          *      Returns:
  377.          *          HXR_OK - If success.
  378.          *          HXR_FAIL - IUnknown parameter did not support the IHXTLogObserver interface.
  379.          */
  380.         STDMETHOD       (Subscribe) (THIS_ 
  381.                         IUnknown*                       /*IN*/                  pUnknown, 
  382.                         const char*             /*IN*/                  szFilterStr, 
  383.                         const char*             /*IN*/                  szLocale, 
  384.                         BOOL                                    /*IN*/                  bCatchUp) PURE; 
  385.         /************************************************************************
  386.          *      Method:
  387.          *          IHXTLogObserverManager::SetFilter
  388.          *      Purpose:
  389.          *          Applies the specified filter to all future log messages delivered to
  390.          *                      the specified observer.
  391.          *      Parameters:
  392.          *          szFilterStr - [in] XML string specifying a filter for this
  393.          *                                      observer.
  394.          *          pObserver - [in] An IUnknown pointer to a previously subscribed observer
  395.          *                                      which will have the filter applied to it.
  396.          *      Returns:
  397.          *          HXR_OK - Since the filter is applied asynchronously, the function will
  398.          *               Always succeed.
  399.          */
  400.         STDMETHOD (SetFilter) (THIS_ 
  401.                         const char*             /*IN*/                  szFilterStr, 
  402.                         IUnknown*                       /*IN*/                  pObserver) PURE; 
  403.         /************************************************************************
  404.          *      Method:
  405.          *          IHXTLogObserverManager::Unsubscribe
  406.          *      Purpose:
  407.          *          Removes an observer from the log system.
  408.          *      Parameters:
  409.          *          pUnknown - [in] IUnknown pointer to the observer object to be 
  410.          *                                      removed.
  411.          *          bReceiveUnsentMessages - [in] Indicates whether the observer wishes 
  412.          *                                      have delivered all messages which have been received by the log 
  413.          *                                      system but not yet delivered to this observer.
  414.          *      Returns:
  415.          *          HXR_OK - If success.
  416.          *          HXR_FAIL - The specified observer was not subscribed to the log system.
  417.          */
  418.         STDMETHOD (Unsubscribe) (THIS_ 
  419.                 IUnknown*                       /*IN*/                  pObserver, 
  420.                 BOOL                                    /*IN*/                  bReceiveUnsentMessages) PURE; 
  421.         /************************************************************************
  422.          *      Method:
  423.          *          IHXTLogObserverManager::SetLanguage
  424.          *      Purpose:
  425.          *          Sets the language which will be used for translatable messages when
  426.          *                      messages are delivered to the specified observer.
  427.          *      Parameters:
  428.          *          szLanguage - [in] Language in which the observer wishes to receive log 
  429.          *                                      messages.  **Currently ignored**
  430.          *          pObserver - [in] IUnknown pointer to the observer which will have its
  431.          *                                      language value set.
  432.          *      Returns:
  433.          *          HXR_OK - If success.
  434.          *          HXR_FAIL - Observer was not subscribed to the log system.
  435.          */
  436.         STDMETHOD (SetLanguage) (THIS_ 
  437.                 const char*                     /*IN*/                  szLanguage, 
  438.                 IUnknown*                               /*IN*/                  pObserver) PURE;
  439. };
  440. //$ Private.
  441. HXT_MAKE_SMART_PTR(IHXTLogObserverManager)
  442. //$ EndPrivate.
  443. /****************************************************************************
  444.  *
  445.  *  Interface:
  446.  *
  447.  *  IHXTLogObserverManager2
  448.  *
  449.  *  Purpose:
  450.  *
  451.  *  This interface add FlushAllObservers method to IHXTLogObserverManager's methods.
  452.  *
  453.  *      IID_IHXTLogObserverManager2:
  454.  *
  455.  *  // {0E38953F-25AD-4efb-9AD4-2CBBC9D62AB0}
  456.  *
  457.  */
  458. // {0E38953F-25AD-4efb-9AD4-2CBBC9D62AB0}
  459. DEFINE_GUID(IID_IHXTLogObserverManager2, 
  460. 0xe38953f, 0x25ad, 0x4efb, 0x9a, 0xd4, 0x2c, 0xbb, 0xc9, 0xd6, 0x2a, 0xb0);
  461. #undef INTERFACE
  462. #define INTERFACE IHXTLogObserverManager2
  463. DECLARE_INTERFACE_(IHXTLogObserverManager2, IHXTLogObserverManager)
  464. {
  465.         /************************************************************************
  466.          *      Method:
  467.          *          IHXTLogObserverManager2::FlushObservers
  468.          *      Purpose:
  469.          *          Flushes the log messages from log queue and calls Flush on all observers.
  470.          *      Returns:
  471.          *          HXR_OK - If success.
  472.          *          HXR_FAIL - failure.
  473.          */
  474.         STDMETHOD(FlushObservers) (THIS) PURE;
  475. };
  476. HXT_MAKE_SMART_PTR(IHXTLogObserverManager2)
  477. /****************************************************************************
  478.  *
  479.  *  Interface:
  480.  *
  481.  *  IHXTLogWriter
  482.  *
  483.  *  Purpose:
  484.  *
  485.  *  This interface is used to send log messages to the log system.
  486.  *
  487.  *      IID_IHXTLogWriter:
  488.  *
  489.  *  {EA6ABCD9-66EB-11d4-931A-00D0B749DE42}
  490.  *
  491.  */
  492. DEFINE_GUID(IID_IHXTLogWriter, 
  493. 0xea6abcd9, 0x66eb, 0x11d4, 0x93, 0x1a, 0x0, 0xd0, 0xb7, 0x49, 0xde, 0x42);
  494. #undef INTERFACE
  495. #define INTERFACE IHXTLogWriter
  496. DECLARE_INTERFACE_(IHXTLogWriter, IUnknown)
  497. {
  498.         /*
  499.          *      IUnknown methods
  500.          */
  501.         STDMETHOD(QueryInterface)               (THIS_
  502.                                 REFIID riid,
  503.                                 void** ppvObj) PURE;
  504.         STDMETHOD_(ULONG32,AddRef)              (THIS) PURE;
  505.         STDMETHOD_(ULONG32,Release)             (THIS) PURE;
  506.         /************************************************************************
  507.          *      Method:
  508.          *          IHXTLogWriter::LogMessage
  509.          *      Purpose:
  510.          *          Logs a message in the log system with the specified parameters
  511.          *                      to be delivered to all observers.
  512.          *
  513.          *      Parameters:
  514.          *          szNamespace - [in] Text identifier to qualify the functional area
  515.          *                                      and numeric message parameter.
  516.          *          nLogCode - [in] Enumerated value from rtalogconstants.h which 
  517.          *                                      indicates the importance of the log message 
  518.          *          nFuncArea - [in] Enumerated value from rtalogconstnats.h which 
  519.          *                                      indicates the general area of the system where the message
  520.          *                                      originated.
  521.          *          nMsg - [in] Identifies the log message to be used from the translation
  522.          *                                      xml files loaded by the log system upon startup.  To use the
  523.          *                                      szMsg variable for the message instead, specify 0xFFFFFFFF for 
  524.          *                                      this value.
  525.          *          szMsg - [in] Contains the text that will be used for the log message if 
  526.          *                                      the nMsg parameter is 0xFFFFFFFF.
  527.          *      Returns:
  528.          *          HXR_OK - if success
  529.          *          HXR_FAIL - Log system is not properly initialized.
  530.          */
  531.         STDMETHOD(LogMessage) (THIS_ 
  532.                                 const char*                     /*IN*/          szNamespace, 
  533.                                 EHXTLogCode                                     /*IN*/          nLogCode, 
  534.                                 EHXTLogFuncArea                         /*IN*/          nFuncArea,
  535.                                 UINT32                                  /*IN*/          nMsg, 
  536.                                 const char*                     /*IN*/          szMsg
  537.                                 ) PURE;
  538.         /************************************************************************
  539.          *      Method:
  540.          *          IHXTLogWriter::GetTranslatedMessage
  541.          *      Purpose:
  542.          *          Retrieves the translated string for the message number provided
  543.          *                      from the log system.
  544.          *
  545.          *      Parameters:
  546.          *          nMessageNumber - [in] Message number to be translated.
  547.          *          szNamespace - [in] Namespace of the message to be translated.
  548.          *                      szLanguage - [in] Currently unused.
  549.          *          szMessage - [out] Translated message string.
  550.          *      Returns:
  551.          *          HXR_OK - if success
  552.          */
  553.         STDMETHOD(GetTranslatedMessage) (THIS_ 
  554.                                 UINT32                                                          /*IN*/          nMessageNumber, 
  555.                                 const char*                                             /*IN*/          szNamespace, 
  556.                                 const char*                                             /*IN*/          szLanguage,
  557.                                 const char**                                    /*OUT*/         szMessage
  558.                                 ) PURE;
  559. };
  560. HXT_MAKE_SMART_PTR(IHXTLogWriter)
  561. // {E7ADC1B7-7B6E-4e54-9878-AA810ECC6DE6}
  562. DEFINE_GUID(IID_IHXTInternalLogWriter, 
  563. 0xe7adc1b7, 0x7b6e, 0x4e54, 0x98, 0x78, 0xaa, 0x81, 0xe, 0xcc, 0x6d, 0xe6);
  564. #undef INTERFACE
  565. #define INTERFACE IHXTInternalLogWriter
  566. DECLARE_INTERFACE_(IHXTInternalLogWriter, IUnknown)
  567. {
  568.         /*
  569.          *      IUnknown methods
  570.          */
  571.         STDMETHOD(QueryInterface)               (THIS_
  572.                                 REFIID riid,
  573.                                 void** ppvObj) PURE;
  574.         STDMETHOD_(ULONG32,AddRef)              (THIS) PURE;
  575.         STDMETHOD_(ULONG32,Release)             (THIS) PURE;
  576.         /************************************************************************
  577.          *      Method:
  578.          *          IHXTLogWriter::LogMessage
  579.          *      Purpose:
  580.          *          Logs a message in the log system with the specified parameters
  581.          *                      to be delivered to all observers.
  582.          *
  583.          *      Parameters:
  584.          *          szNamespace - [in] Text identifier to qualify the functional area
  585.          *                                      and numeric message parameter.
  586.          *          nLogCode - [in] Enumerated value from rtalogconstants.h which 
  587.          *                                      indicates the importance of the log message 
  588.          *          nFuncArea - [in] Enumerated value from rtalogconstnats.h which 
  589.          *                                      indicates the general area of the system where the message
  590.          *                                      originated.
  591.          *          nMsg - [in] Identifies the log message to be used from the translation
  592.          *                                      xml files loaded by the log system upon startup.  To use the
  593.          *                                      szMsg variable for the message instead, specify 0xFFFFFFFF for 
  594.          *                                      this value.
  595.          *          szMsg - [in] Contains the text that will be used for the log message if 
  596.          *                                      the nMsg parameter is 0xFFFFFFFF.
  597.          *          args - [in] The list of variable arguments that will be substituted into
  598.          *                                      the log message by the log system using sprintf
  599.          *      Returns:
  600.          *          HXR_OK - if success
  601.          *          HXR_FAIL - Log system is not properly initialized.
  602.          */
  603.         STDMETHOD(LogMessage) (THIS_ 
  604.                                 const char*                     /*IN*/          szNamespace, 
  605.                                 EHXTLogCode                                     /*IN*/          nLogCode, 
  606.                                 EHXTLogFuncArea                         /*IN*/          nFuncArea,
  607.                                 UINT32                                  /*IN*/          nMsg, 
  608.                                 const char*                     /*IN*/          szMsg, 
  609.                                 va_list                                 /*IN*/          args) PURE;
  610. };
  611. HXT_MAKE_SMART_PTR(IHXTInternalLogWriter)
  612. /****************************************************************************
  613.  *
  614.  *  Interface:
  615.  *
  616.  *  IHXTLogSystem
  617.  *
  618.  *  Purpose:
  619.  *                      Provides access to the areas of the log system
  620.  *  
  621.  *      IID_IHXTLogSystem:
  622.  *
  623.  *  // {E50F7E51-4640-11d5-935B-00D0B749DE42}
  624.  *
  625.  */
  626. DEFINE_GUID(IID_IHXTLogSystem, 
  627. 0xe50f7e51, 0x4640, 0x11d5, 0x93, 0x5b, 0x0, 0xd0, 0xb7, 0x49, 0xde, 0x42);
  628. #undef INTERFACE
  629. #define INTERFACE IHXTLogSystem
  630. DECLARE_INTERFACE_(IHXTLogSystem, IUnknown)
  631. {
  632.         /*
  633.          *      IUnknown methods
  634.          */
  635.         STDMETHOD(QueryInterface)               (THIS_
  636.                                 REFIID riid,
  637.                                 void** ppvObj) PURE;
  638.         STDMETHOD_(ULONG32,AddRef)              (THIS) PURE;
  639.         STDMETHOD_(ULONG32,Release)             (THIS) PURE;
  640.         /************************************************************************
  641.          *      Method:
  642.          *          IHXTLogSystem::Shutdown
  643.          *      Purpose:
  644.          *          Properly shuts down the log system.
  645.          *      Parameters:
  646.          *      None.
  647.          *      Returns:
  648.          *          HXR_OK - If success.
  649.          *          HXR_FAIL - Log system could not shutdown properly.
  650.          *      Notes:
  651.          *                      Under Windows, this method should not be called from within DllMain().
  652.          */
  653.         STDMETHOD(Shutdown) (THIS) PURE;
  654.         /************************************************************************
  655.          *      Method:
  656.          *          IHXTLogSystem::SetTranslationFileDirectory
  657.          *      Purpose:
  658.          *          Sets the translation file directory for the log system.
  659.          *      Parameters:
  660.          *          szTranslationFileDir - [in] Location of all log system translation files.  These
  661.          *                  files will be used to translate message numbers into text strings.
  662.          *      Returns:
  663.          *          HXR_OK - If success.
  664.          *          HXR_FAIL - Translation file directory already set.
  665.          */
  666.         STDMETHOD(SetTranslationFileDirectory) (THIS_ const char* szTranslationFileDir) PURE;
  667.         /************************************************************************
  668.          *      Method:
  669.          *          IHXTLogSystem::GetWriterInterface
  670.          *      Purpose:
  671.          *          Retrieves an interface to the log writer, used to send messages
  672.          *                      into the log system.
  673.          *      Parameters:
  674.          *          ppIWriter - [out] Address of output variable that receives 
  675.          *                  the log writer interface pointer.
  676.          *      Returns:
  677.          *          HXR_OK - If success.
  678.          *          HXR_FAIL - Log system not properly initialized.
  679.          */
  680.         STDMETHOD(GetWriterInterface) (THIS_ 
  681.                         IHXTLogWriter**                 /*OUT*/                 ppIWriter) PURE;
  682.         /************************************************************************
  683.          *      Method:
  684.          *          IHXTLogSystem::GetObserverManagerInterface
  685.          *      Purpose:
  686.          *          Retrieves an interface to the observer manager, used to subscribe,
  687.          *                      manage, and unsubscribe listening observer which receive log messages.
  688.          *      Parameters:
  689.          *          ppILogObserverManager - [out] Address of output variable that receives 
  690.          *                  the observer manager interface pointer.
  691.          *      Returns:
  692.          *          HXR_OK - If success.
  693.          *          HXR_FAIL - Log system not properly initialized.
  694.          */
  695.         STDMETHOD(GetObserverManagerInterface)(THIS_ 
  696.                 IHXTLogObserverManager**                        /*OUT*/                 ppILogObserverManager) PURE;
  697.         /************************************************************************
  698.          *      Method:
  699.          *          IHXTLogSystem::GetFunctionalAreaEnumerator
  700.          *      Purpose:
  701.          *          Retrieves an interface to an enumerator which will enumerate through
  702.          *                      all functional areas in all namespaces in the specified language  
  703.          *                      loaded on log system initialization.
  704.          *      Parameters:
  705.          *          pIEnum - [out] Address of output variable that receives 
  706.          *                  the enumerator interface pointer.
  707.          *                      szLanguage - [in] The language of the functional areas to be enumerated.
  708.          *      Returns:
  709.          *          HXR_OK - If success.
  710.          *          HXR_FAIL - Log system not properly initialized.
  711.          */
  712.         STDMETHOD(GetFunctionalAreaEnumerator)  (
  713.                 IHXTFuncAreaEnum**                      /*OUT*/                 pIEnum, 
  714.                 const char*                                             /*IN*/                  szLanguage) PURE;
  715. };
  716. /****************************************************************************
  717.  *  Function:
  718.  *      RMAGetLogSystemInterface
  719.  *  Purpose:
  720.  *      Obtains an interface pointer to the log system.  If the log system has not 
  721.  *      yet been created, it is created and initialized.
  722.  */
  723. typedef HX_RESULT (STDAPICALLTYPE *FPRMAGETLOGSYSTEMINTERFACE)(IHXTLogSystem** ppLogSystem);
  724. HXT_MAKE_SMART_PTR(IHXTLogSystem)
  725. #endif /* #ifndef IHXTLOGSYSTEM_H */