Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.8 KiB

  1. // AdFile.h: interface for the CAdFile class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_ADFILE_H__4792C231_E8B3_11D0_8A87_00C0F00910F9__INCLUDED_)
  5. #define AFX_ADFILE_H__4792C231_E8B3_11D0_8A87_00C0F00910F9__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. #include "RefCount.h"
  10. #include "AdDesc.h"
  11. #include "Monitor.h"
  12. #include "rdwrt.h"
  13. class CAdFileNotify : public CMonitorNotify
  14. {
  15. public:
  16. CAdFileNotify();
  17. virtual void Notify();
  18. bool IsNotified();
  19. private:
  20. long m_isNotified;
  21. };
  22. DECLARE_REFPTR( CAdFileNotify,CMonitorNotify )
  23. class CAdFile : public CRefCounter, public CReadWrite
  24. {
  25. public:
  26. enum
  27. {
  28. defaultHeight = 60,
  29. defaultWidth = 440,
  30. defaultHSpace = 0,
  31. defaultVSpace = 0,
  32. defaultBorder = 1
  33. };
  34. CAdFile();
  35. CAdDescPtr RandomAd() const;
  36. bool Refresh();
  37. bool ProcessAdFile( String strAdFile );
  38. short Border() const { return m_nBorder; }
  39. int Height() const { return m_nHeight; }
  40. int Width() const { return m_nWidth; }
  41. int VSpace() const { return m_nVSpace; }
  42. int HSpace() const { return m_nHSpace; }
  43. const String& Redirector() const { return m_strRedirector; }
  44. bool fUTF8() const { return m_fUTF8; }
  45. private:
  46. typedef TVector< CAdDescPtr > AdListT;
  47. bool ReadHeader( FileInStream& fs );
  48. virtual ~CAdFile();
  49. String m_strFile;
  50. short m_nBorder;
  51. int m_nHeight;
  52. int m_nWidth;
  53. int m_nVSpace;
  54. int m_nHSpace;
  55. String m_strRedirector;
  56. AdListT m_ads;
  57. CAdFileNotifyPtr m_pNotify;
  58. bool m_fUTF8;
  59. };
  60. typedef TRefPtr<CAdFile> CAdFilePtr;
  61. #endif // !defined(AFX_ADFILE_H__4792C231_E8B3_11D0_8A87_00C0F00910F9__INCLUDED_)