home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / utility / CStLayerOriginSetter.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.6 KB  |  55 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /*
  20. CStLayerOriginSetter
  21.  
  22. This class is used to set the layer origin temporarily.  For example, if you are dragging and
  23. dropping and want the origin to be changed to the item you're dragging, you would do (in
  24. CHTMLView):
  25.  
  26.  
  27. do stuff with old origin
  28. {
  29.     CStOriginSetter setLayerOrigin(this, in_layer);
  30.     do your dragging stuff with new origin
  31. }
  32. do other stuff with old origin
  33.  
  34. This class thus handles any exceptions, etc. that are done while doing stuff with the new
  35. origin.  
  36.  
  37. NOTE: This class should never be subclassed.
  38. */
  39.  
  40. #pragma once
  41.  
  42. #include "CHTMLView.h"
  43.  
  44. class CStLayerOriginSetter {
  45.  
  46.     public:
  47.             CStLayerOriginSetter(CHTMLView *viewToSet, CL_Layer *the_layer);
  48.             ~CStLayerOriginSetter();
  49.             
  50.     private:
  51.             Int32 mOldx;
  52.             Int32 mOldy;
  53.             CHTMLView *mViewToSet;
  54.             Boolean mShouldChange;
  55. };