00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiWord 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * Copyright (C) 2001-2002 Hubert Figuiere 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00020 * 02110-1301 USA. 00021 */ 00022 00023 #ifndef AP_COCOATOPRULER_H 00024 #define AP_COCOATOPRULER_H 00025 00026 // Class for dealing with the horizontal ruler at the top of 00027 // a document window. 00028 00029 /*****************************************************************/ 00030 00031 #import <Cocoa/Cocoa.h> 00032 00033 #include "ut_types.h" 00034 #include "ap_TopRuler.h" 00035 00036 class XAP_Frame; 00037 @class AP_CocoaTopRulerDelegate; 00038 00039 00040 /*****************************************************************/ 00041 00042 class AP_CocoaTopRuler : public AP_TopRuler 00043 { 00044 public: 00045 AP_CocoaTopRuler(XAP_Frame * pFrame); 00046 virtual ~AP_CocoaTopRuler(void); 00047 00048 virtual void setView(AV_View * pView); 00049 00050 // cheats for the callbacks 00051 void getWidgetPosition(int * x, int * y); 00052 XAP_CocoaNSView * getWidget(void) { return m_wTopRuler; }; 00053 NSWindow * getRootWindow(void); 00054 00055 protected: 00056 #if 0 00057 virtual void _drawMarginProperties(const UT_Rect * pClipRect, AP_TopRulerInfo * pInfo, GR_Graphics::GR_Color3D clr); 00058 virtual void _drawLeftIndentMarker(UT_Rect & r, bool bFilled); 00059 virtual void _drawRightIndentMarker(UT_Rect & r, bool bFilled); 00060 virtual void _drawFirstLineIndentMarker(UT_Rect & rect, bool bFilled); 00061 virtual void _drawColumnGapMarker(UT_Rect & rect); 00062 virtual void _drawCellMark(UT_Rect * prDrag, bool bUp); 00063 #endif 00064 00065 private: 00066 static bool _graphicsUpdateCB(NSRect * aRect, GR_CocoaCairoGraphics *pG, void* param); 00067 00068 XAP_CocoaNSView * m_wTopRuler; 00069 NSWindow * m_rootWindow; 00070 AP_CocoaTopRulerDelegate* m_delegate; 00071 }; 00072 00073 #endif /* AP_COCOATOPRULER_H */