1*3398c5b8SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3398c5b8SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3398c5b8SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3398c5b8SAndrew Rist * distributed with this work for additional information 6*3398c5b8SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3398c5b8SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3398c5b8SAndrew Rist * "License"); you may not use this file except in compliance 9*3398c5b8SAndrew Rist * with the License. You may obtain a copy of the License at 10*3398c5b8SAndrew Rist * 11*3398c5b8SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3398c5b8SAndrew Rist * 13*3398c5b8SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3398c5b8SAndrew Rist * software distributed under the License is distributed on an 15*3398c5b8SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3398c5b8SAndrew Rist * KIND, either express or implied. See the License for the 17*3398c5b8SAndrew Rist * specific language governing permissions and limitations 18*3398c5b8SAndrew Rist * under the License. 19*3398c5b8SAndrew Rist * 20*3398c5b8SAndrew Rist *************************************************************/ 21*3398c5b8SAndrew Rist 22*3398c5b8SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include <tools/string.hxx> 25cdf0e10cSrcweir #include <tools/link.hxx> 26cdf0e10cSrcweir #include <vcl/timer.hxx> 27cdf0e10cSrcweir 28cdf0e10cSrcweir class ToolBox; 29cdf0e10cSrcweir class Window; 30cdf0e10cSrcweir class VclSimpleEvent; 31cdf0e10cSrcweir 32cdf0e10cSrcweir class MacroRecorder 33cdf0e10cSrcweir { 34cdf0e10cSrcweir private: 35cdf0e10cSrcweir Window* GetParentWithID( Window* pThis ); 36cdf0e10cSrcweir rtl::OString GetParentID( Window* pThis ); 37cdf0e10cSrcweir 38cdf0e10cSrcweir Link aEventListenerHdl; 39cdf0e10cSrcweir DECL_LINK( EventListener, VclSimpleEvent* ); 40cdf0e10cSrcweir 41cdf0e10cSrcweir Window* pLastWin; 42cdf0e10cSrcweir Window* pEditModify; 43cdf0e10cSrcweir String aEditModifyString; 44cdf0e10cSrcweir 45cdf0e10cSrcweir ToolBox *pActionParent; // toolbox from which a tearoff or OpenMenu might happen 46cdf0e10cSrcweir 47cdf0e10cSrcweir // record keys 48cdf0e10cSrcweir String aKeyString; 49cdf0e10cSrcweir rtl::OString aKeyUniqueID; // has to be remembered seperately since Window might be gone when needed 50cdf0e10cSrcweir Window* pKeyWin; 51cdf0e10cSrcweir sal_Bool bKeyFollowFocus; 52cdf0e10cSrcweir 53cdf0e10cSrcweir AutoTimer aHookRefresh; 54cdf0e10cSrcweir void AddEventHooks(); 55cdf0e10cSrcweir void RemoveEventHooks(); 56cdf0e10cSrcweir DECL_LINK( HookRefreshHdl, void* ); 57cdf0e10cSrcweir 58cdf0e10cSrcweir void LogVCL( rtl::OString aParentID, sal_uInt16 nVCLWindowType, rtl::OString aID, String aMethod, sal_uInt16 aParam ); 59cdf0e10cSrcweir void LogVCL( rtl::OString aParentID, sal_uInt16 nVCLWindowType, rtl::OString aID, String aMethod ); 60cdf0e10cSrcweir 61cdf0e10cSrcweir static MacroRecorder *pMacroRecorder; 62cdf0e10cSrcweir 63cdf0e10cSrcweir MacroRecorder(); 64cdf0e10cSrcweir ~MacroRecorder(); 65cdf0e10cSrcweir void CheckDelete(); 66cdf0e10cSrcweir 67cdf0e10cSrcweir // Actions to perform 68cdf0e10cSrcweir sal_Bool m_bRecord; 69cdf0e10cSrcweir sal_Bool m_bLog; 70cdf0e10cSrcweir 71cdf0e10cSrcweir public: 72cdf0e10cSrcweir SetActionRecord(sal_Bool bRecord=sal_True)73cdf0e10cSrcweir void SetActionRecord( sal_Bool bRecord = sal_True ) { m_bRecord = bRecord; CheckDelete(); }; SetActionLog(sal_Bool bLog=sal_True)74cdf0e10cSrcweir void SetActionLog( sal_Bool bLog = sal_True ) { m_bLog = bLog; CheckDelete(); }; 75cdf0e10cSrcweir 76cdf0e10cSrcweir static MacroRecorder* GetMacroRecorder(); 77cdf0e10cSrcweir static sal_Bool HasMacroRecorder(); 78cdf0e10cSrcweir }; 79cdf0e10cSrcweir 80