13398c5b8SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 33398c5b8SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 43398c5b8SAndrew Rist * or more contributor license agreements. See the NOTICE file 53398c5b8SAndrew Rist * distributed with this work for additional information 63398c5b8SAndrew Rist * regarding copyright ownership. The ASF licenses this file 73398c5b8SAndrew Rist * to you under the Apache License, Version 2.0 (the 83398c5b8SAndrew Rist * "License"); you may not use this file except in compliance 93398c5b8SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 113398c5b8SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 133398c5b8SAndrew Rist * Unless required by applicable law or agreed to in writing, 143398c5b8SAndrew Rist * software distributed under the License is distributed on an 153398c5b8SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 163398c5b8SAndrew Rist * KIND, either express or implied. See the License for the 173398c5b8SAndrew Rist * specific language governing permissions and limitations 183398c5b8SAndrew Rist * under the License. 19cdf0e10cSrcweir * 203398c5b8SAndrew Rist *************************************************************/ 213398c5b8SAndrew Rist 223398c5b8SAndrew 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; 49*07a3d7f1SPedro Giffuni rtl::OString aKeyUniqueID; // has to be remembered separately 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 }; 79