1 /*****************************************************************************/
3 // Written by Michael Wilber, OBOS Translation Kit Team
7 // BView class for showing images. Images can be dropped on this view
8 // from the tracker and images viewed in this view can be dragged
9 // to the tracker to be saved.
12 // Copyright (c) 2003 OpenBeOS Project
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 /*****************************************************************************/
40 #include <TranslatorRoster.h>
42 class ImageView
: public BView
{
44 ImageView(BRect rect
, const char *name
);
47 void AttachedToWindow();
48 void Draw(BRect rect
);
49 void FrameResized(float width
, float height
);
50 void MouseDown(BPoint point
);
51 void MouseMoved(BPoint point
, uint32 state
, const BMessage
*pmsg
);
52 void MouseUp(BPoint point
);
53 void MessageReceived(BMessage
*pmsg
);
55 void SetImage(BMessage
*pmsg
);
56 bool HasImage() { return fpbitmap
? true : false; };
64 void UpdateInfoWindow(const BPath
&path
, BMessage
&ioExtension
,
65 const translator_info
&info
, BTranslatorRoster
*proster
);
67 void AdjustScrollBars();
68 void SaveImageAtDropLocation(BMessage
*pmsg
);
70 BTranslatorRoster
*SelectTranslatorRoster(BTranslatorRoster
&roster
);
72 entry_ref fcurrentRef
;
78 #endif // #ifndef IMAGEVIEW_H