1 /* 2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef TITLE_PLACEHOLDER_MAPPER_H 6 #define TITLE_PLACEHOLDER_MAPPER_H 7 8 9 #include "ActiveProcessInfo.h" 10 #include "PatternEvaluator.h" 11 #include "ShellInfo.h" 12 13 14 /*! Class mapping the placeholders common for window and tab titles. 15 */ 16 class TitlePlaceholderMapper : public PatternEvaluator::PlaceholderMapper { 17 public: 18 TitlePlaceholderMapper( 19 const ShellInfo& shellInfo, 20 const ActiveProcessInfo& processInfo); 21 22 virtual bool MapPlaceholder(char placeholder, 23 int64 number, bool numberGiven, 24 BString& _string); 25 26 private: 27 ShellInfo fShellInfo; 28 ActiveProcessInfo fProcessInfo; 29 }; 30 31 32 class WindowTitlePlaceholderMapper : public TitlePlaceholderMapper { 33 public: 34 WindowTitlePlaceholderMapper( 35 const ShellInfo& shellInfo, 36 const ActiveProcessInfo& processInfo, 37 int32 windowIndex, const BString& tabTitle); 38 39 virtual bool MapPlaceholder(char placeholder, 40 int64 number, bool numberGiven, 41 BString& _string); 42 43 private: 44 int32 fWindowIndex; 45 BString fTabTitle; 46 }; 47 48 49 class TabTitlePlaceholderMapper : public TitlePlaceholderMapper { 50 public: 51 TabTitlePlaceholderMapper( 52 const ShellInfo& shellInfo, 53 const ActiveProcessInfo& processInfo, 54 int32 tabIndex); 55 56 virtual bool MapPlaceholder(char placeholder, 57 int64 number, bool numberGiven, 58 BString& _string); 59 60 private: 61 int32 fTabIndex; 62 }; 63 64 65 #endif // TITLE_PLACEHOLDER_MAPPER_H 66